
obj/user/divzero.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 33 00 00 00       	call   800064 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:

int zero;

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	83 ec 10             	sub    $0x10,%esp
	zero = 0;
  80003d:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  800044:	00 00 00 
	cprintf("1/0 is %08x!\n", 1/zero);
  800047:	b8 01 00 00 00       	mov    $0x1,%eax
  80004c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800051:	99                   	cltd   
  800052:	f7 f9                	idiv   %ecx
  800054:	50                   	push   %eax
  800055:	68 00 1f 80 00       	push   $0x801f00
  80005a:	e8 14 01 00 00       	call   800173 <cprintf>
}
  80005f:	83 c4 10             	add    $0x10,%esp
  800062:	c9                   	leave  
  800063:	c3                   	ret    

00800064 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800064:	f3 0f 1e fb          	endbr32 
  800068:	55                   	push   %ebp
  800069:	89 e5                	mov    %esp,%ebp
  80006b:	56                   	push   %esi
  80006c:	53                   	push   %ebx
  80006d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  800070:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800073:	c7 05 08 40 80 00 00 	movl   $0x0,0x804008
  80007a:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  80007d:	e8 c6 0a 00 00       	call   800b48 <sys_getenvid>
  800082:	25 ff 03 00 00       	and    $0x3ff,%eax
  800087:	6b c0 7c             	imul   $0x7c,%eax,%eax
  80008a:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  80008f:	a3 08 40 80 00       	mov    %eax,0x804008

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800094:	85 db                	test   %ebx,%ebx
  800096:	7e 07                	jle    80009f <libmain+0x3b>
		binaryname = argv[0];
  800098:	8b 06                	mov    (%esi),%eax
  80009a:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  80009f:	83 ec 08             	sub    $0x8,%esp
  8000a2:	56                   	push   %esi
  8000a3:	53                   	push   %ebx
  8000a4:	e8 8a ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  8000a9:	e8 0a 00 00 00       	call   8000b8 <exit>
}
  8000ae:	83 c4 10             	add    $0x10,%esp
  8000b1:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000b4:	5b                   	pop    %ebx
  8000b5:	5e                   	pop    %esi
  8000b6:	5d                   	pop    %ebp
  8000b7:	c3                   	ret    

008000b8 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000b8:	f3 0f 1e fb          	endbr32 
  8000bc:	55                   	push   %ebp
  8000bd:	89 e5                	mov    %esp,%ebp
  8000bf:	83 ec 08             	sub    $0x8,%esp
	close_all();
  8000c2:	e8 c7 0e 00 00       	call   800f8e <close_all>
	sys_env_destroy(0);
  8000c7:	83 ec 0c             	sub    $0xc,%esp
  8000ca:	6a 00                	push   $0x0
  8000cc:	e8 32 0a 00 00       	call   800b03 <sys_env_destroy>
}
  8000d1:	83 c4 10             	add    $0x10,%esp
  8000d4:	c9                   	leave  
  8000d5:	c3                   	ret    

008000d6 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  8000d6:	f3 0f 1e fb          	endbr32 
  8000da:	55                   	push   %ebp
  8000db:	89 e5                	mov    %esp,%ebp
  8000dd:	53                   	push   %ebx
  8000de:	83 ec 04             	sub    $0x4,%esp
  8000e1:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8000e4:	8b 13                	mov    (%ebx),%edx
  8000e6:	8d 42 01             	lea    0x1(%edx),%eax
  8000e9:	89 03                	mov    %eax,(%ebx)
  8000eb:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8000ee:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  8000f2:	3d ff 00 00 00       	cmp    $0xff,%eax
  8000f7:	74 09                	je     800102 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8000f9:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8000fd:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800100:	c9                   	leave  
  800101:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  800102:	83 ec 08             	sub    $0x8,%esp
  800105:	68 ff 00 00 00       	push   $0xff
  80010a:	8d 43 08             	lea    0x8(%ebx),%eax
  80010d:	50                   	push   %eax
  80010e:	e8 ab 09 00 00       	call   800abe <sys_cputs>
		b->idx = 0;
  800113:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800119:	83 c4 10             	add    $0x10,%esp
  80011c:	eb db                	jmp    8000f9 <putch+0x23>

0080011e <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  80011e:	f3 0f 1e fb          	endbr32 
  800122:	55                   	push   %ebp
  800123:	89 e5                	mov    %esp,%ebp
  800125:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  80012b:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800132:	00 00 00 
	b.cnt = 0;
  800135:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  80013c:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  80013f:	ff 75 0c             	pushl  0xc(%ebp)
  800142:	ff 75 08             	pushl  0x8(%ebp)
  800145:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  80014b:	50                   	push   %eax
  80014c:	68 d6 00 80 00       	push   $0x8000d6
  800151:	e8 20 01 00 00       	call   800276 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800156:	83 c4 08             	add    $0x8,%esp
  800159:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80015f:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800165:	50                   	push   %eax
  800166:	e8 53 09 00 00       	call   800abe <sys_cputs>

	return b.cnt;
}
  80016b:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800171:	c9                   	leave  
  800172:	c3                   	ret    

00800173 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800173:	f3 0f 1e fb          	endbr32 
  800177:	55                   	push   %ebp
  800178:	89 e5                	mov    %esp,%ebp
  80017a:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  80017d:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  800180:	50                   	push   %eax
  800181:	ff 75 08             	pushl  0x8(%ebp)
  800184:	e8 95 ff ff ff       	call   80011e <vcprintf>
	va_end(ap);

	return cnt;
}
  800189:	c9                   	leave  
  80018a:	c3                   	ret    

0080018b <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  80018b:	55                   	push   %ebp
  80018c:	89 e5                	mov    %esp,%ebp
  80018e:	57                   	push   %edi
  80018f:	56                   	push   %esi
  800190:	53                   	push   %ebx
  800191:	83 ec 1c             	sub    $0x1c,%esp
  800194:	89 c7                	mov    %eax,%edi
  800196:	89 d6                	mov    %edx,%esi
  800198:	8b 45 08             	mov    0x8(%ebp),%eax
  80019b:	8b 55 0c             	mov    0xc(%ebp),%edx
  80019e:	89 d1                	mov    %edx,%ecx
  8001a0:	89 c2                	mov    %eax,%edx
  8001a2:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8001a5:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8001a8:	8b 45 10             	mov    0x10(%ebp),%eax
  8001ab:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8001ae:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8001b1:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8001b8:	39 c2                	cmp    %eax,%edx
  8001ba:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8001bd:	72 3e                	jb     8001fd <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8001bf:	83 ec 0c             	sub    $0xc,%esp
  8001c2:	ff 75 18             	pushl  0x18(%ebp)
  8001c5:	83 eb 01             	sub    $0x1,%ebx
  8001c8:	53                   	push   %ebx
  8001c9:	50                   	push   %eax
  8001ca:	83 ec 08             	sub    $0x8,%esp
  8001cd:	ff 75 e4             	pushl  -0x1c(%ebp)
  8001d0:	ff 75 e0             	pushl  -0x20(%ebp)
  8001d3:	ff 75 dc             	pushl  -0x24(%ebp)
  8001d6:	ff 75 d8             	pushl  -0x28(%ebp)
  8001d9:	e8 b2 1a 00 00       	call   801c90 <__udivdi3>
  8001de:	83 c4 18             	add    $0x18,%esp
  8001e1:	52                   	push   %edx
  8001e2:	50                   	push   %eax
  8001e3:	89 f2                	mov    %esi,%edx
  8001e5:	89 f8                	mov    %edi,%eax
  8001e7:	e8 9f ff ff ff       	call   80018b <printnum>
  8001ec:	83 c4 20             	add    $0x20,%esp
  8001ef:	eb 13                	jmp    800204 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  8001f1:	83 ec 08             	sub    $0x8,%esp
  8001f4:	56                   	push   %esi
  8001f5:	ff 75 18             	pushl  0x18(%ebp)
  8001f8:	ff d7                	call   *%edi
  8001fa:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8001fd:	83 eb 01             	sub    $0x1,%ebx
  800200:	85 db                	test   %ebx,%ebx
  800202:	7f ed                	jg     8001f1 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  800204:	83 ec 08             	sub    $0x8,%esp
  800207:	56                   	push   %esi
  800208:	83 ec 04             	sub    $0x4,%esp
  80020b:	ff 75 e4             	pushl  -0x1c(%ebp)
  80020e:	ff 75 e0             	pushl  -0x20(%ebp)
  800211:	ff 75 dc             	pushl  -0x24(%ebp)
  800214:	ff 75 d8             	pushl  -0x28(%ebp)
  800217:	e8 84 1b 00 00       	call   801da0 <__umoddi3>
  80021c:	83 c4 14             	add    $0x14,%esp
  80021f:	0f be 80 18 1f 80 00 	movsbl 0x801f18(%eax),%eax
  800226:	50                   	push   %eax
  800227:	ff d7                	call   *%edi
}
  800229:	83 c4 10             	add    $0x10,%esp
  80022c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80022f:	5b                   	pop    %ebx
  800230:	5e                   	pop    %esi
  800231:	5f                   	pop    %edi
  800232:	5d                   	pop    %ebp
  800233:	c3                   	ret    

00800234 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800234:	f3 0f 1e fb          	endbr32 
  800238:	55                   	push   %ebp
  800239:	89 e5                	mov    %esp,%ebp
  80023b:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  80023e:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800242:	8b 10                	mov    (%eax),%edx
  800244:	3b 50 04             	cmp    0x4(%eax),%edx
  800247:	73 0a                	jae    800253 <sprintputch+0x1f>
		*b->buf++ = ch;
  800249:	8d 4a 01             	lea    0x1(%edx),%ecx
  80024c:	89 08                	mov    %ecx,(%eax)
  80024e:	8b 45 08             	mov    0x8(%ebp),%eax
  800251:	88 02                	mov    %al,(%edx)
}
  800253:	5d                   	pop    %ebp
  800254:	c3                   	ret    

00800255 <printfmt>:
{
  800255:	f3 0f 1e fb          	endbr32 
  800259:	55                   	push   %ebp
  80025a:	89 e5                	mov    %esp,%ebp
  80025c:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80025f:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800262:	50                   	push   %eax
  800263:	ff 75 10             	pushl  0x10(%ebp)
  800266:	ff 75 0c             	pushl  0xc(%ebp)
  800269:	ff 75 08             	pushl  0x8(%ebp)
  80026c:	e8 05 00 00 00       	call   800276 <vprintfmt>
}
  800271:	83 c4 10             	add    $0x10,%esp
  800274:	c9                   	leave  
  800275:	c3                   	ret    

00800276 <vprintfmt>:
{
  800276:	f3 0f 1e fb          	endbr32 
  80027a:	55                   	push   %ebp
  80027b:	89 e5                	mov    %esp,%ebp
  80027d:	57                   	push   %edi
  80027e:	56                   	push   %esi
  80027f:	53                   	push   %ebx
  800280:	83 ec 3c             	sub    $0x3c,%esp
  800283:	8b 75 08             	mov    0x8(%ebp),%esi
  800286:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  800289:	8b 7d 10             	mov    0x10(%ebp),%edi
  80028c:	e9 5d 03 00 00       	jmp    8005ee <vprintfmt+0x378>
		padc = ' ';
  800291:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  800295:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  80029c:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8002a3:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8002aa:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8002af:	8d 47 01             	lea    0x1(%edi),%eax
  8002b2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8002b5:	0f b6 17             	movzbl (%edi),%edx
  8002b8:	8d 42 dd             	lea    -0x23(%edx),%eax
  8002bb:	3c 55                	cmp    $0x55,%al
  8002bd:	0f 87 ae 03 00 00    	ja     800671 <vprintfmt+0x3fb>
  8002c3:	0f b6 c0             	movzbl %al,%eax
  8002c6:	3e ff 24 85 60 20 80 	notrack jmp *0x802060(,%eax,4)
  8002cd:	00 
  8002ce:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  8002d1:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  8002d5:	eb d8                	jmp    8002af <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8002d7:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8002da:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8002de:	eb cf                	jmp    8002af <vprintfmt+0x39>
  8002e0:	0f b6 d2             	movzbl %dl,%edx
  8002e3:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  8002e6:	b8 00 00 00 00       	mov    $0x0,%eax
  8002eb:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8002ee:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8002f1:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  8002f5:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8002f8:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8002fb:	83 f9 09             	cmp    $0x9,%ecx
  8002fe:	77 55                	ja     800355 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  800300:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  800303:	eb e9                	jmp    8002ee <vprintfmt+0x78>
			precision = va_arg(ap, int);
  800305:	8b 45 14             	mov    0x14(%ebp),%eax
  800308:	8b 00                	mov    (%eax),%eax
  80030a:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80030d:	8b 45 14             	mov    0x14(%ebp),%eax
  800310:	8d 40 04             	lea    0x4(%eax),%eax
  800313:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800316:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800319:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80031d:	79 90                	jns    8002af <vprintfmt+0x39>
				width = precision, precision = -1;
  80031f:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800322:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800325:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  80032c:	eb 81                	jmp    8002af <vprintfmt+0x39>
  80032e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  800331:	85 c0                	test   %eax,%eax
  800333:	ba 00 00 00 00       	mov    $0x0,%edx
  800338:	0f 49 d0             	cmovns %eax,%edx
  80033b:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  80033e:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800341:	e9 69 ff ff ff       	jmp    8002af <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800346:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800349:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  800350:	e9 5a ff ff ff       	jmp    8002af <vprintfmt+0x39>
  800355:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800358:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80035b:	eb bc                	jmp    800319 <vprintfmt+0xa3>
			lflag++;
  80035d:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800360:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800363:	e9 47 ff ff ff       	jmp    8002af <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800368:	8b 45 14             	mov    0x14(%ebp),%eax
  80036b:	8d 78 04             	lea    0x4(%eax),%edi
  80036e:	83 ec 08             	sub    $0x8,%esp
  800371:	53                   	push   %ebx
  800372:	ff 30                	pushl  (%eax)
  800374:	ff d6                	call   *%esi
			break;
  800376:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800379:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  80037c:	e9 6a 02 00 00       	jmp    8005eb <vprintfmt+0x375>
			err = va_arg(ap, int);
  800381:	8b 45 14             	mov    0x14(%ebp),%eax
  800384:	8d 78 04             	lea    0x4(%eax),%edi
  800387:	8b 00                	mov    (%eax),%eax
  800389:	99                   	cltd   
  80038a:	31 d0                	xor    %edx,%eax
  80038c:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  80038e:	83 f8 0f             	cmp    $0xf,%eax
  800391:	7f 23                	jg     8003b6 <vprintfmt+0x140>
  800393:	8b 14 85 c0 21 80 00 	mov    0x8021c0(,%eax,4),%edx
  80039a:	85 d2                	test   %edx,%edx
  80039c:	74 18                	je     8003b6 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  80039e:	52                   	push   %edx
  80039f:	68 f1 22 80 00       	push   $0x8022f1
  8003a4:	53                   	push   %ebx
  8003a5:	56                   	push   %esi
  8003a6:	e8 aa fe ff ff       	call   800255 <printfmt>
  8003ab:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003ae:	89 7d 14             	mov    %edi,0x14(%ebp)
  8003b1:	e9 35 02 00 00       	jmp    8005eb <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8003b6:	50                   	push   %eax
  8003b7:	68 30 1f 80 00       	push   $0x801f30
  8003bc:	53                   	push   %ebx
  8003bd:	56                   	push   %esi
  8003be:	e8 92 fe ff ff       	call   800255 <printfmt>
  8003c3:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003c6:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  8003c9:	e9 1d 02 00 00       	jmp    8005eb <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  8003ce:	8b 45 14             	mov    0x14(%ebp),%eax
  8003d1:	83 c0 04             	add    $0x4,%eax
  8003d4:	89 45 c8             	mov    %eax,-0x38(%ebp)
  8003d7:	8b 45 14             	mov    0x14(%ebp),%eax
  8003da:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8003dc:	85 d2                	test   %edx,%edx
  8003de:	b8 29 1f 80 00       	mov    $0x801f29,%eax
  8003e3:	0f 45 c2             	cmovne %edx,%eax
  8003e6:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8003e9:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8003ed:	7e 06                	jle    8003f5 <vprintfmt+0x17f>
  8003ef:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  8003f3:	75 0d                	jne    800402 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  8003f5:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8003f8:	89 c7                	mov    %eax,%edi
  8003fa:	03 45 d4             	add    -0x2c(%ebp),%eax
  8003fd:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800400:	eb 55                	jmp    800457 <vprintfmt+0x1e1>
  800402:	83 ec 08             	sub    $0x8,%esp
  800405:	ff 75 d8             	pushl  -0x28(%ebp)
  800408:	ff 75 cc             	pushl  -0x34(%ebp)
  80040b:	e8 15 03 00 00       	call   800725 <strnlen>
  800410:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800413:	29 c2                	sub    %eax,%edx
  800415:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800418:	83 c4 10             	add    $0x10,%esp
  80041b:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  80041d:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  800421:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  800424:	85 ff                	test   %edi,%edi
  800426:	7e 11                	jle    800439 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800428:	83 ec 08             	sub    $0x8,%esp
  80042b:	53                   	push   %ebx
  80042c:	ff 75 d4             	pushl  -0x2c(%ebp)
  80042f:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  800431:	83 ef 01             	sub    $0x1,%edi
  800434:	83 c4 10             	add    $0x10,%esp
  800437:	eb eb                	jmp    800424 <vprintfmt+0x1ae>
  800439:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  80043c:	85 d2                	test   %edx,%edx
  80043e:	b8 00 00 00 00       	mov    $0x0,%eax
  800443:	0f 49 c2             	cmovns %edx,%eax
  800446:	29 c2                	sub    %eax,%edx
  800448:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  80044b:	eb a8                	jmp    8003f5 <vprintfmt+0x17f>
					putch(ch, putdat);
  80044d:	83 ec 08             	sub    $0x8,%esp
  800450:	53                   	push   %ebx
  800451:	52                   	push   %edx
  800452:	ff d6                	call   *%esi
  800454:	83 c4 10             	add    $0x10,%esp
  800457:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  80045a:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80045c:	83 c7 01             	add    $0x1,%edi
  80045f:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800463:	0f be d0             	movsbl %al,%edx
  800466:	85 d2                	test   %edx,%edx
  800468:	74 4b                	je     8004b5 <vprintfmt+0x23f>
  80046a:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  80046e:	78 06                	js     800476 <vprintfmt+0x200>
  800470:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  800474:	78 1e                	js     800494 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800476:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80047a:	74 d1                	je     80044d <vprintfmt+0x1d7>
  80047c:	0f be c0             	movsbl %al,%eax
  80047f:	83 e8 20             	sub    $0x20,%eax
  800482:	83 f8 5e             	cmp    $0x5e,%eax
  800485:	76 c6                	jbe    80044d <vprintfmt+0x1d7>
					putch('?', putdat);
  800487:	83 ec 08             	sub    $0x8,%esp
  80048a:	53                   	push   %ebx
  80048b:	6a 3f                	push   $0x3f
  80048d:	ff d6                	call   *%esi
  80048f:	83 c4 10             	add    $0x10,%esp
  800492:	eb c3                	jmp    800457 <vprintfmt+0x1e1>
  800494:	89 cf                	mov    %ecx,%edi
  800496:	eb 0e                	jmp    8004a6 <vprintfmt+0x230>
				putch(' ', putdat);
  800498:	83 ec 08             	sub    $0x8,%esp
  80049b:	53                   	push   %ebx
  80049c:	6a 20                	push   $0x20
  80049e:	ff d6                	call   *%esi
			for (; width > 0; width--)
  8004a0:	83 ef 01             	sub    $0x1,%edi
  8004a3:	83 c4 10             	add    $0x10,%esp
  8004a6:	85 ff                	test   %edi,%edi
  8004a8:	7f ee                	jg     800498 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8004aa:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8004ad:	89 45 14             	mov    %eax,0x14(%ebp)
  8004b0:	e9 36 01 00 00       	jmp    8005eb <vprintfmt+0x375>
  8004b5:	89 cf                	mov    %ecx,%edi
  8004b7:	eb ed                	jmp    8004a6 <vprintfmt+0x230>
	if (lflag >= 2)
  8004b9:	83 f9 01             	cmp    $0x1,%ecx
  8004bc:	7f 1f                	jg     8004dd <vprintfmt+0x267>
	else if (lflag)
  8004be:	85 c9                	test   %ecx,%ecx
  8004c0:	74 67                	je     800529 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8004c2:	8b 45 14             	mov    0x14(%ebp),%eax
  8004c5:	8b 00                	mov    (%eax),%eax
  8004c7:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004ca:	89 c1                	mov    %eax,%ecx
  8004cc:	c1 f9 1f             	sar    $0x1f,%ecx
  8004cf:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8004d2:	8b 45 14             	mov    0x14(%ebp),%eax
  8004d5:	8d 40 04             	lea    0x4(%eax),%eax
  8004d8:	89 45 14             	mov    %eax,0x14(%ebp)
  8004db:	eb 17                	jmp    8004f4 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8004dd:	8b 45 14             	mov    0x14(%ebp),%eax
  8004e0:	8b 50 04             	mov    0x4(%eax),%edx
  8004e3:	8b 00                	mov    (%eax),%eax
  8004e5:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004e8:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8004eb:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ee:	8d 40 08             	lea    0x8(%eax),%eax
  8004f1:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  8004f4:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8004f7:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8004fa:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8004ff:	85 c9                	test   %ecx,%ecx
  800501:	0f 89 ca 00 00 00    	jns    8005d1 <vprintfmt+0x35b>
				putch('-', putdat);
  800507:	83 ec 08             	sub    $0x8,%esp
  80050a:	53                   	push   %ebx
  80050b:	6a 2d                	push   $0x2d
  80050d:	ff d6                	call   *%esi
				num = -(long long) num;
  80050f:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800512:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800515:	f7 da                	neg    %edx
  800517:	83 d1 00             	adc    $0x0,%ecx
  80051a:	f7 d9                	neg    %ecx
  80051c:	83 c4 10             	add    $0x10,%esp
			base = 10;
  80051f:	b8 0a 00 00 00       	mov    $0xa,%eax
  800524:	e9 a8 00 00 00       	jmp    8005d1 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800529:	8b 45 14             	mov    0x14(%ebp),%eax
  80052c:	8b 00                	mov    (%eax),%eax
  80052e:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800531:	99                   	cltd   
  800532:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800535:	8b 45 14             	mov    0x14(%ebp),%eax
  800538:	8d 40 04             	lea    0x4(%eax),%eax
  80053b:	89 45 14             	mov    %eax,0x14(%ebp)
  80053e:	eb b4                	jmp    8004f4 <vprintfmt+0x27e>
	if (lflag >= 2)
  800540:	83 f9 01             	cmp    $0x1,%ecx
  800543:	7f 1b                	jg     800560 <vprintfmt+0x2ea>
	else if (lflag)
  800545:	85 c9                	test   %ecx,%ecx
  800547:	74 2c                	je     800575 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800549:	8b 45 14             	mov    0x14(%ebp),%eax
  80054c:	8b 10                	mov    (%eax),%edx
  80054e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800553:	8d 40 04             	lea    0x4(%eax),%eax
  800556:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800559:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80055e:	eb 71                	jmp    8005d1 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800560:	8b 45 14             	mov    0x14(%ebp),%eax
  800563:	8b 10                	mov    (%eax),%edx
  800565:	8b 48 04             	mov    0x4(%eax),%ecx
  800568:	8d 40 08             	lea    0x8(%eax),%eax
  80056b:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80056e:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800573:	eb 5c                	jmp    8005d1 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800575:	8b 45 14             	mov    0x14(%ebp),%eax
  800578:	8b 10                	mov    (%eax),%edx
  80057a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80057f:	8d 40 04             	lea    0x4(%eax),%eax
  800582:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800585:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  80058a:	eb 45                	jmp    8005d1 <vprintfmt+0x35b>
			putch('X', putdat);
  80058c:	83 ec 08             	sub    $0x8,%esp
  80058f:	53                   	push   %ebx
  800590:	6a 58                	push   $0x58
  800592:	ff d6                	call   *%esi
			putch('X', putdat);
  800594:	83 c4 08             	add    $0x8,%esp
  800597:	53                   	push   %ebx
  800598:	6a 58                	push   $0x58
  80059a:	ff d6                	call   *%esi
			putch('X', putdat);
  80059c:	83 c4 08             	add    $0x8,%esp
  80059f:	53                   	push   %ebx
  8005a0:	6a 58                	push   $0x58
  8005a2:	ff d6                	call   *%esi
			break;
  8005a4:	83 c4 10             	add    $0x10,%esp
  8005a7:	eb 42                	jmp    8005eb <vprintfmt+0x375>
			putch('0', putdat);
  8005a9:	83 ec 08             	sub    $0x8,%esp
  8005ac:	53                   	push   %ebx
  8005ad:	6a 30                	push   $0x30
  8005af:	ff d6                	call   *%esi
			putch('x', putdat);
  8005b1:	83 c4 08             	add    $0x8,%esp
  8005b4:	53                   	push   %ebx
  8005b5:	6a 78                	push   $0x78
  8005b7:	ff d6                	call   *%esi
			num = (unsigned long long)
  8005b9:	8b 45 14             	mov    0x14(%ebp),%eax
  8005bc:	8b 10                	mov    (%eax),%edx
  8005be:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8005c3:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  8005c6:	8d 40 04             	lea    0x4(%eax),%eax
  8005c9:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8005cc:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  8005d1:	83 ec 0c             	sub    $0xc,%esp
  8005d4:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  8005d8:	57                   	push   %edi
  8005d9:	ff 75 d4             	pushl  -0x2c(%ebp)
  8005dc:	50                   	push   %eax
  8005dd:	51                   	push   %ecx
  8005de:	52                   	push   %edx
  8005df:	89 da                	mov    %ebx,%edx
  8005e1:	89 f0                	mov    %esi,%eax
  8005e3:	e8 a3 fb ff ff       	call   80018b <printnum>
			break;
  8005e8:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8005eb:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8005ee:	83 c7 01             	add    $0x1,%edi
  8005f1:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8005f5:	83 f8 25             	cmp    $0x25,%eax
  8005f8:	0f 84 93 fc ff ff    	je     800291 <vprintfmt+0x1b>
			if (ch == '\0')
  8005fe:	85 c0                	test   %eax,%eax
  800600:	0f 84 8b 00 00 00    	je     800691 <vprintfmt+0x41b>
			putch(ch, putdat);
  800606:	83 ec 08             	sub    $0x8,%esp
  800609:	53                   	push   %ebx
  80060a:	50                   	push   %eax
  80060b:	ff d6                	call   *%esi
  80060d:	83 c4 10             	add    $0x10,%esp
  800610:	eb dc                	jmp    8005ee <vprintfmt+0x378>
	if (lflag >= 2)
  800612:	83 f9 01             	cmp    $0x1,%ecx
  800615:	7f 1b                	jg     800632 <vprintfmt+0x3bc>
	else if (lflag)
  800617:	85 c9                	test   %ecx,%ecx
  800619:	74 2c                	je     800647 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  80061b:	8b 45 14             	mov    0x14(%ebp),%eax
  80061e:	8b 10                	mov    (%eax),%edx
  800620:	b9 00 00 00 00       	mov    $0x0,%ecx
  800625:	8d 40 04             	lea    0x4(%eax),%eax
  800628:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80062b:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  800630:	eb 9f                	jmp    8005d1 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800632:	8b 45 14             	mov    0x14(%ebp),%eax
  800635:	8b 10                	mov    (%eax),%edx
  800637:	8b 48 04             	mov    0x4(%eax),%ecx
  80063a:	8d 40 08             	lea    0x8(%eax),%eax
  80063d:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800640:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800645:	eb 8a                	jmp    8005d1 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800647:	8b 45 14             	mov    0x14(%ebp),%eax
  80064a:	8b 10                	mov    (%eax),%edx
  80064c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800651:	8d 40 04             	lea    0x4(%eax),%eax
  800654:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800657:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80065c:	e9 70 ff ff ff       	jmp    8005d1 <vprintfmt+0x35b>
			putch(ch, putdat);
  800661:	83 ec 08             	sub    $0x8,%esp
  800664:	53                   	push   %ebx
  800665:	6a 25                	push   $0x25
  800667:	ff d6                	call   *%esi
			break;
  800669:	83 c4 10             	add    $0x10,%esp
  80066c:	e9 7a ff ff ff       	jmp    8005eb <vprintfmt+0x375>
			putch('%', putdat);
  800671:	83 ec 08             	sub    $0x8,%esp
  800674:	53                   	push   %ebx
  800675:	6a 25                	push   $0x25
  800677:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800679:	83 c4 10             	add    $0x10,%esp
  80067c:	89 f8                	mov    %edi,%eax
  80067e:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800682:	74 05                	je     800689 <vprintfmt+0x413>
  800684:	83 e8 01             	sub    $0x1,%eax
  800687:	eb f5                	jmp    80067e <vprintfmt+0x408>
  800689:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80068c:	e9 5a ff ff ff       	jmp    8005eb <vprintfmt+0x375>
}
  800691:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800694:	5b                   	pop    %ebx
  800695:	5e                   	pop    %esi
  800696:	5f                   	pop    %edi
  800697:	5d                   	pop    %ebp
  800698:	c3                   	ret    

00800699 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  800699:	f3 0f 1e fb          	endbr32 
  80069d:	55                   	push   %ebp
  80069e:	89 e5                	mov    %esp,%ebp
  8006a0:	83 ec 18             	sub    $0x18,%esp
  8006a3:	8b 45 08             	mov    0x8(%ebp),%eax
  8006a6:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8006a9:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8006ac:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8006b0:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8006b3:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8006ba:	85 c0                	test   %eax,%eax
  8006bc:	74 26                	je     8006e4 <vsnprintf+0x4b>
  8006be:	85 d2                	test   %edx,%edx
  8006c0:	7e 22                	jle    8006e4 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8006c2:	ff 75 14             	pushl  0x14(%ebp)
  8006c5:	ff 75 10             	pushl  0x10(%ebp)
  8006c8:	8d 45 ec             	lea    -0x14(%ebp),%eax
  8006cb:	50                   	push   %eax
  8006cc:	68 34 02 80 00       	push   $0x800234
  8006d1:	e8 a0 fb ff ff       	call   800276 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  8006d6:	8b 45 ec             	mov    -0x14(%ebp),%eax
  8006d9:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8006dc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8006df:	83 c4 10             	add    $0x10,%esp
}
  8006e2:	c9                   	leave  
  8006e3:	c3                   	ret    
		return -E_INVAL;
  8006e4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8006e9:	eb f7                	jmp    8006e2 <vsnprintf+0x49>

008006eb <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8006eb:	f3 0f 1e fb          	endbr32 
  8006ef:	55                   	push   %ebp
  8006f0:	89 e5                	mov    %esp,%ebp
  8006f2:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  8006f5:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  8006f8:	50                   	push   %eax
  8006f9:	ff 75 10             	pushl  0x10(%ebp)
  8006fc:	ff 75 0c             	pushl  0xc(%ebp)
  8006ff:	ff 75 08             	pushl  0x8(%ebp)
  800702:	e8 92 ff ff ff       	call   800699 <vsnprintf>
	va_end(ap);

	return rc;
}
  800707:	c9                   	leave  
  800708:	c3                   	ret    

00800709 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800709:	f3 0f 1e fb          	endbr32 
  80070d:	55                   	push   %ebp
  80070e:	89 e5                	mov    %esp,%ebp
  800710:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800713:	b8 00 00 00 00       	mov    $0x0,%eax
  800718:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80071c:	74 05                	je     800723 <strlen+0x1a>
		n++;
  80071e:	83 c0 01             	add    $0x1,%eax
  800721:	eb f5                	jmp    800718 <strlen+0xf>
	return n;
}
  800723:	5d                   	pop    %ebp
  800724:	c3                   	ret    

00800725 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800725:	f3 0f 1e fb          	endbr32 
  800729:	55                   	push   %ebp
  80072a:	89 e5                	mov    %esp,%ebp
  80072c:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80072f:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800732:	b8 00 00 00 00       	mov    $0x0,%eax
  800737:	39 d0                	cmp    %edx,%eax
  800739:	74 0d                	je     800748 <strnlen+0x23>
  80073b:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  80073f:	74 05                	je     800746 <strnlen+0x21>
		n++;
  800741:	83 c0 01             	add    $0x1,%eax
  800744:	eb f1                	jmp    800737 <strnlen+0x12>
  800746:	89 c2                	mov    %eax,%edx
	return n;
}
  800748:	89 d0                	mov    %edx,%eax
  80074a:	5d                   	pop    %ebp
  80074b:	c3                   	ret    

0080074c <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80074c:	f3 0f 1e fb          	endbr32 
  800750:	55                   	push   %ebp
  800751:	89 e5                	mov    %esp,%ebp
  800753:	53                   	push   %ebx
  800754:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800757:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  80075a:	b8 00 00 00 00       	mov    $0x0,%eax
  80075f:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800763:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800766:	83 c0 01             	add    $0x1,%eax
  800769:	84 d2                	test   %dl,%dl
  80076b:	75 f2                	jne    80075f <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  80076d:	89 c8                	mov    %ecx,%eax
  80076f:	5b                   	pop    %ebx
  800770:	5d                   	pop    %ebp
  800771:	c3                   	ret    

00800772 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800772:	f3 0f 1e fb          	endbr32 
  800776:	55                   	push   %ebp
  800777:	89 e5                	mov    %esp,%ebp
  800779:	53                   	push   %ebx
  80077a:	83 ec 10             	sub    $0x10,%esp
  80077d:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  800780:	53                   	push   %ebx
  800781:	e8 83 ff ff ff       	call   800709 <strlen>
  800786:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800789:	ff 75 0c             	pushl  0xc(%ebp)
  80078c:	01 d8                	add    %ebx,%eax
  80078e:	50                   	push   %eax
  80078f:	e8 b8 ff ff ff       	call   80074c <strcpy>
	return dst;
}
  800794:	89 d8                	mov    %ebx,%eax
  800796:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800799:	c9                   	leave  
  80079a:	c3                   	ret    

0080079b <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  80079b:	f3 0f 1e fb          	endbr32 
  80079f:	55                   	push   %ebp
  8007a0:	89 e5                	mov    %esp,%ebp
  8007a2:	56                   	push   %esi
  8007a3:	53                   	push   %ebx
  8007a4:	8b 75 08             	mov    0x8(%ebp),%esi
  8007a7:	8b 55 0c             	mov    0xc(%ebp),%edx
  8007aa:	89 f3                	mov    %esi,%ebx
  8007ac:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8007af:	89 f0                	mov    %esi,%eax
  8007b1:	39 d8                	cmp    %ebx,%eax
  8007b3:	74 11                	je     8007c6 <strncpy+0x2b>
		*dst++ = *src;
  8007b5:	83 c0 01             	add    $0x1,%eax
  8007b8:	0f b6 0a             	movzbl (%edx),%ecx
  8007bb:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8007be:	80 f9 01             	cmp    $0x1,%cl
  8007c1:	83 da ff             	sbb    $0xffffffff,%edx
  8007c4:	eb eb                	jmp    8007b1 <strncpy+0x16>
	}
	return ret;
}
  8007c6:	89 f0                	mov    %esi,%eax
  8007c8:	5b                   	pop    %ebx
  8007c9:	5e                   	pop    %esi
  8007ca:	5d                   	pop    %ebp
  8007cb:	c3                   	ret    

008007cc <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  8007cc:	f3 0f 1e fb          	endbr32 
  8007d0:	55                   	push   %ebp
  8007d1:	89 e5                	mov    %esp,%ebp
  8007d3:	56                   	push   %esi
  8007d4:	53                   	push   %ebx
  8007d5:	8b 75 08             	mov    0x8(%ebp),%esi
  8007d8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8007db:	8b 55 10             	mov    0x10(%ebp),%edx
  8007de:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8007e0:	85 d2                	test   %edx,%edx
  8007e2:	74 21                	je     800805 <strlcpy+0x39>
  8007e4:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  8007e8:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  8007ea:	39 c2                	cmp    %eax,%edx
  8007ec:	74 14                	je     800802 <strlcpy+0x36>
  8007ee:	0f b6 19             	movzbl (%ecx),%ebx
  8007f1:	84 db                	test   %bl,%bl
  8007f3:	74 0b                	je     800800 <strlcpy+0x34>
			*dst++ = *src++;
  8007f5:	83 c1 01             	add    $0x1,%ecx
  8007f8:	83 c2 01             	add    $0x1,%edx
  8007fb:	88 5a ff             	mov    %bl,-0x1(%edx)
  8007fe:	eb ea                	jmp    8007ea <strlcpy+0x1e>
  800800:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800802:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800805:	29 f0                	sub    %esi,%eax
}
  800807:	5b                   	pop    %ebx
  800808:	5e                   	pop    %esi
  800809:	5d                   	pop    %ebp
  80080a:	c3                   	ret    

0080080b <strcmp>:

int
strcmp(const char *p, const char *q)
{
  80080b:	f3 0f 1e fb          	endbr32 
  80080f:	55                   	push   %ebp
  800810:	89 e5                	mov    %esp,%ebp
  800812:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800815:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800818:	0f b6 01             	movzbl (%ecx),%eax
  80081b:	84 c0                	test   %al,%al
  80081d:	74 0c                	je     80082b <strcmp+0x20>
  80081f:	3a 02                	cmp    (%edx),%al
  800821:	75 08                	jne    80082b <strcmp+0x20>
		p++, q++;
  800823:	83 c1 01             	add    $0x1,%ecx
  800826:	83 c2 01             	add    $0x1,%edx
  800829:	eb ed                	jmp    800818 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  80082b:	0f b6 c0             	movzbl %al,%eax
  80082e:	0f b6 12             	movzbl (%edx),%edx
  800831:	29 d0                	sub    %edx,%eax
}
  800833:	5d                   	pop    %ebp
  800834:	c3                   	ret    

00800835 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800835:	f3 0f 1e fb          	endbr32 
  800839:	55                   	push   %ebp
  80083a:	89 e5                	mov    %esp,%ebp
  80083c:	53                   	push   %ebx
  80083d:	8b 45 08             	mov    0x8(%ebp),%eax
  800840:	8b 55 0c             	mov    0xc(%ebp),%edx
  800843:	89 c3                	mov    %eax,%ebx
  800845:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800848:	eb 06                	jmp    800850 <strncmp+0x1b>
		n--, p++, q++;
  80084a:	83 c0 01             	add    $0x1,%eax
  80084d:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  800850:	39 d8                	cmp    %ebx,%eax
  800852:	74 16                	je     80086a <strncmp+0x35>
  800854:	0f b6 08             	movzbl (%eax),%ecx
  800857:	84 c9                	test   %cl,%cl
  800859:	74 04                	je     80085f <strncmp+0x2a>
  80085b:	3a 0a                	cmp    (%edx),%cl
  80085d:	74 eb                	je     80084a <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  80085f:	0f b6 00             	movzbl (%eax),%eax
  800862:	0f b6 12             	movzbl (%edx),%edx
  800865:	29 d0                	sub    %edx,%eax
}
  800867:	5b                   	pop    %ebx
  800868:	5d                   	pop    %ebp
  800869:	c3                   	ret    
		return 0;
  80086a:	b8 00 00 00 00       	mov    $0x0,%eax
  80086f:	eb f6                	jmp    800867 <strncmp+0x32>

00800871 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  800871:	f3 0f 1e fb          	endbr32 
  800875:	55                   	push   %ebp
  800876:	89 e5                	mov    %esp,%ebp
  800878:	8b 45 08             	mov    0x8(%ebp),%eax
  80087b:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80087f:	0f b6 10             	movzbl (%eax),%edx
  800882:	84 d2                	test   %dl,%dl
  800884:	74 09                	je     80088f <strchr+0x1e>
		if (*s == c)
  800886:	38 ca                	cmp    %cl,%dl
  800888:	74 0a                	je     800894 <strchr+0x23>
	for (; *s; s++)
  80088a:	83 c0 01             	add    $0x1,%eax
  80088d:	eb f0                	jmp    80087f <strchr+0xe>
			return (char *) s;
	return 0;
  80088f:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800894:	5d                   	pop    %ebp
  800895:	c3                   	ret    

00800896 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  800896:	f3 0f 1e fb          	endbr32 
  80089a:	55                   	push   %ebp
  80089b:	89 e5                	mov    %esp,%ebp
  80089d:	8b 45 08             	mov    0x8(%ebp),%eax
  8008a0:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008a4:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8008a7:	38 ca                	cmp    %cl,%dl
  8008a9:	74 09                	je     8008b4 <strfind+0x1e>
  8008ab:	84 d2                	test   %dl,%dl
  8008ad:	74 05                	je     8008b4 <strfind+0x1e>
	for (; *s; s++)
  8008af:	83 c0 01             	add    $0x1,%eax
  8008b2:	eb f0                	jmp    8008a4 <strfind+0xe>
			break;
	return (char *) s;
}
  8008b4:	5d                   	pop    %ebp
  8008b5:	c3                   	ret    

008008b6 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8008b6:	f3 0f 1e fb          	endbr32 
  8008ba:	55                   	push   %ebp
  8008bb:	89 e5                	mov    %esp,%ebp
  8008bd:	57                   	push   %edi
  8008be:	56                   	push   %esi
  8008bf:	53                   	push   %ebx
  8008c0:	8b 7d 08             	mov    0x8(%ebp),%edi
  8008c3:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8008c6:	85 c9                	test   %ecx,%ecx
  8008c8:	74 31                	je     8008fb <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8008ca:	89 f8                	mov    %edi,%eax
  8008cc:	09 c8                	or     %ecx,%eax
  8008ce:	a8 03                	test   $0x3,%al
  8008d0:	75 23                	jne    8008f5 <memset+0x3f>
		c &= 0xFF;
  8008d2:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8008d6:	89 d3                	mov    %edx,%ebx
  8008d8:	c1 e3 08             	shl    $0x8,%ebx
  8008db:	89 d0                	mov    %edx,%eax
  8008dd:	c1 e0 18             	shl    $0x18,%eax
  8008e0:	89 d6                	mov    %edx,%esi
  8008e2:	c1 e6 10             	shl    $0x10,%esi
  8008e5:	09 f0                	or     %esi,%eax
  8008e7:	09 c2                	or     %eax,%edx
  8008e9:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  8008eb:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  8008ee:	89 d0                	mov    %edx,%eax
  8008f0:	fc                   	cld    
  8008f1:	f3 ab                	rep stos %eax,%es:(%edi)
  8008f3:	eb 06                	jmp    8008fb <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  8008f5:	8b 45 0c             	mov    0xc(%ebp),%eax
  8008f8:	fc                   	cld    
  8008f9:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  8008fb:	89 f8                	mov    %edi,%eax
  8008fd:	5b                   	pop    %ebx
  8008fe:	5e                   	pop    %esi
  8008ff:	5f                   	pop    %edi
  800900:	5d                   	pop    %ebp
  800901:	c3                   	ret    

00800902 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800902:	f3 0f 1e fb          	endbr32 
  800906:	55                   	push   %ebp
  800907:	89 e5                	mov    %esp,%ebp
  800909:	57                   	push   %edi
  80090a:	56                   	push   %esi
  80090b:	8b 45 08             	mov    0x8(%ebp),%eax
  80090e:	8b 75 0c             	mov    0xc(%ebp),%esi
  800911:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800914:	39 c6                	cmp    %eax,%esi
  800916:	73 32                	jae    80094a <memmove+0x48>
  800918:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  80091b:	39 c2                	cmp    %eax,%edx
  80091d:	76 2b                	jbe    80094a <memmove+0x48>
		s += n;
		d += n;
  80091f:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800922:	89 fe                	mov    %edi,%esi
  800924:	09 ce                	or     %ecx,%esi
  800926:	09 d6                	or     %edx,%esi
  800928:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80092e:	75 0e                	jne    80093e <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800930:	83 ef 04             	sub    $0x4,%edi
  800933:	8d 72 fc             	lea    -0x4(%edx),%esi
  800936:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800939:	fd                   	std    
  80093a:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80093c:	eb 09                	jmp    800947 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  80093e:	83 ef 01             	sub    $0x1,%edi
  800941:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800944:	fd                   	std    
  800945:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800947:	fc                   	cld    
  800948:	eb 1a                	jmp    800964 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  80094a:	89 c2                	mov    %eax,%edx
  80094c:	09 ca                	or     %ecx,%edx
  80094e:	09 f2                	or     %esi,%edx
  800950:	f6 c2 03             	test   $0x3,%dl
  800953:	75 0a                	jne    80095f <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800955:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800958:	89 c7                	mov    %eax,%edi
  80095a:	fc                   	cld    
  80095b:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80095d:	eb 05                	jmp    800964 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  80095f:	89 c7                	mov    %eax,%edi
  800961:	fc                   	cld    
  800962:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800964:	5e                   	pop    %esi
  800965:	5f                   	pop    %edi
  800966:	5d                   	pop    %ebp
  800967:	c3                   	ret    

00800968 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800968:	f3 0f 1e fb          	endbr32 
  80096c:	55                   	push   %ebp
  80096d:	89 e5                	mov    %esp,%ebp
  80096f:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800972:	ff 75 10             	pushl  0x10(%ebp)
  800975:	ff 75 0c             	pushl  0xc(%ebp)
  800978:	ff 75 08             	pushl  0x8(%ebp)
  80097b:	e8 82 ff ff ff       	call   800902 <memmove>
}
  800980:	c9                   	leave  
  800981:	c3                   	ret    

00800982 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800982:	f3 0f 1e fb          	endbr32 
  800986:	55                   	push   %ebp
  800987:	89 e5                	mov    %esp,%ebp
  800989:	56                   	push   %esi
  80098a:	53                   	push   %ebx
  80098b:	8b 45 08             	mov    0x8(%ebp),%eax
  80098e:	8b 55 0c             	mov    0xc(%ebp),%edx
  800991:	89 c6                	mov    %eax,%esi
  800993:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800996:	39 f0                	cmp    %esi,%eax
  800998:	74 1c                	je     8009b6 <memcmp+0x34>
		if (*s1 != *s2)
  80099a:	0f b6 08             	movzbl (%eax),%ecx
  80099d:	0f b6 1a             	movzbl (%edx),%ebx
  8009a0:	38 d9                	cmp    %bl,%cl
  8009a2:	75 08                	jne    8009ac <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  8009a4:	83 c0 01             	add    $0x1,%eax
  8009a7:	83 c2 01             	add    $0x1,%edx
  8009aa:	eb ea                	jmp    800996 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  8009ac:	0f b6 c1             	movzbl %cl,%eax
  8009af:	0f b6 db             	movzbl %bl,%ebx
  8009b2:	29 d8                	sub    %ebx,%eax
  8009b4:	eb 05                	jmp    8009bb <memcmp+0x39>
	}

	return 0;
  8009b6:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009bb:	5b                   	pop    %ebx
  8009bc:	5e                   	pop    %esi
  8009bd:	5d                   	pop    %ebp
  8009be:	c3                   	ret    

008009bf <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  8009bf:	f3 0f 1e fb          	endbr32 
  8009c3:	55                   	push   %ebp
  8009c4:	89 e5                	mov    %esp,%ebp
  8009c6:	8b 45 08             	mov    0x8(%ebp),%eax
  8009c9:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  8009cc:	89 c2                	mov    %eax,%edx
  8009ce:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  8009d1:	39 d0                	cmp    %edx,%eax
  8009d3:	73 09                	jae    8009de <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  8009d5:	38 08                	cmp    %cl,(%eax)
  8009d7:	74 05                	je     8009de <memfind+0x1f>
	for (; s < ends; s++)
  8009d9:	83 c0 01             	add    $0x1,%eax
  8009dc:	eb f3                	jmp    8009d1 <memfind+0x12>
			break;
	return (void *) s;
}
  8009de:	5d                   	pop    %ebp
  8009df:	c3                   	ret    

008009e0 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  8009e0:	f3 0f 1e fb          	endbr32 
  8009e4:	55                   	push   %ebp
  8009e5:	89 e5                	mov    %esp,%ebp
  8009e7:	57                   	push   %edi
  8009e8:	56                   	push   %esi
  8009e9:	53                   	push   %ebx
  8009ea:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8009ed:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  8009f0:	eb 03                	jmp    8009f5 <strtol+0x15>
		s++;
  8009f2:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  8009f5:	0f b6 01             	movzbl (%ecx),%eax
  8009f8:	3c 20                	cmp    $0x20,%al
  8009fa:	74 f6                	je     8009f2 <strtol+0x12>
  8009fc:	3c 09                	cmp    $0x9,%al
  8009fe:	74 f2                	je     8009f2 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800a00:	3c 2b                	cmp    $0x2b,%al
  800a02:	74 2a                	je     800a2e <strtol+0x4e>
	int neg = 0;
  800a04:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800a09:	3c 2d                	cmp    $0x2d,%al
  800a0b:	74 2b                	je     800a38 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a0d:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800a13:	75 0f                	jne    800a24 <strtol+0x44>
  800a15:	80 39 30             	cmpb   $0x30,(%ecx)
  800a18:	74 28                	je     800a42 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800a1a:	85 db                	test   %ebx,%ebx
  800a1c:	b8 0a 00 00 00       	mov    $0xa,%eax
  800a21:	0f 44 d8             	cmove  %eax,%ebx
  800a24:	b8 00 00 00 00       	mov    $0x0,%eax
  800a29:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800a2c:	eb 46                	jmp    800a74 <strtol+0x94>
		s++;
  800a2e:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800a31:	bf 00 00 00 00       	mov    $0x0,%edi
  800a36:	eb d5                	jmp    800a0d <strtol+0x2d>
		s++, neg = 1;
  800a38:	83 c1 01             	add    $0x1,%ecx
  800a3b:	bf 01 00 00 00       	mov    $0x1,%edi
  800a40:	eb cb                	jmp    800a0d <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a42:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800a46:	74 0e                	je     800a56 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800a48:	85 db                	test   %ebx,%ebx
  800a4a:	75 d8                	jne    800a24 <strtol+0x44>
		s++, base = 8;
  800a4c:	83 c1 01             	add    $0x1,%ecx
  800a4f:	bb 08 00 00 00       	mov    $0x8,%ebx
  800a54:	eb ce                	jmp    800a24 <strtol+0x44>
		s += 2, base = 16;
  800a56:	83 c1 02             	add    $0x2,%ecx
  800a59:	bb 10 00 00 00       	mov    $0x10,%ebx
  800a5e:	eb c4                	jmp    800a24 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800a60:	0f be d2             	movsbl %dl,%edx
  800a63:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800a66:	3b 55 10             	cmp    0x10(%ebp),%edx
  800a69:	7d 3a                	jge    800aa5 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800a6b:	83 c1 01             	add    $0x1,%ecx
  800a6e:	0f af 45 10          	imul   0x10(%ebp),%eax
  800a72:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800a74:	0f b6 11             	movzbl (%ecx),%edx
  800a77:	8d 72 d0             	lea    -0x30(%edx),%esi
  800a7a:	89 f3                	mov    %esi,%ebx
  800a7c:	80 fb 09             	cmp    $0x9,%bl
  800a7f:	76 df                	jbe    800a60 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800a81:	8d 72 9f             	lea    -0x61(%edx),%esi
  800a84:	89 f3                	mov    %esi,%ebx
  800a86:	80 fb 19             	cmp    $0x19,%bl
  800a89:	77 08                	ja     800a93 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800a8b:	0f be d2             	movsbl %dl,%edx
  800a8e:	83 ea 57             	sub    $0x57,%edx
  800a91:	eb d3                	jmp    800a66 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800a93:	8d 72 bf             	lea    -0x41(%edx),%esi
  800a96:	89 f3                	mov    %esi,%ebx
  800a98:	80 fb 19             	cmp    $0x19,%bl
  800a9b:	77 08                	ja     800aa5 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800a9d:	0f be d2             	movsbl %dl,%edx
  800aa0:	83 ea 37             	sub    $0x37,%edx
  800aa3:	eb c1                	jmp    800a66 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800aa5:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800aa9:	74 05                	je     800ab0 <strtol+0xd0>
		*endptr = (char *) s;
  800aab:	8b 75 0c             	mov    0xc(%ebp),%esi
  800aae:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800ab0:	89 c2                	mov    %eax,%edx
  800ab2:	f7 da                	neg    %edx
  800ab4:	85 ff                	test   %edi,%edi
  800ab6:	0f 45 c2             	cmovne %edx,%eax
}
  800ab9:	5b                   	pop    %ebx
  800aba:	5e                   	pop    %esi
  800abb:	5f                   	pop    %edi
  800abc:	5d                   	pop    %ebp
  800abd:	c3                   	ret    

00800abe <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800abe:	f3 0f 1e fb          	endbr32 
  800ac2:	55                   	push   %ebp
  800ac3:	89 e5                	mov    %esp,%ebp
  800ac5:	57                   	push   %edi
  800ac6:	56                   	push   %esi
  800ac7:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ac8:	b8 00 00 00 00       	mov    $0x0,%eax
  800acd:	8b 55 08             	mov    0x8(%ebp),%edx
  800ad0:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ad3:	89 c3                	mov    %eax,%ebx
  800ad5:	89 c7                	mov    %eax,%edi
  800ad7:	89 c6                	mov    %eax,%esi
  800ad9:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800adb:	5b                   	pop    %ebx
  800adc:	5e                   	pop    %esi
  800add:	5f                   	pop    %edi
  800ade:	5d                   	pop    %ebp
  800adf:	c3                   	ret    

00800ae0 <sys_cgetc>:

int
sys_cgetc(void)
{
  800ae0:	f3 0f 1e fb          	endbr32 
  800ae4:	55                   	push   %ebp
  800ae5:	89 e5                	mov    %esp,%ebp
  800ae7:	57                   	push   %edi
  800ae8:	56                   	push   %esi
  800ae9:	53                   	push   %ebx
	asm volatile("int %1\n"
  800aea:	ba 00 00 00 00       	mov    $0x0,%edx
  800aef:	b8 01 00 00 00       	mov    $0x1,%eax
  800af4:	89 d1                	mov    %edx,%ecx
  800af6:	89 d3                	mov    %edx,%ebx
  800af8:	89 d7                	mov    %edx,%edi
  800afa:	89 d6                	mov    %edx,%esi
  800afc:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800afe:	5b                   	pop    %ebx
  800aff:	5e                   	pop    %esi
  800b00:	5f                   	pop    %edi
  800b01:	5d                   	pop    %ebp
  800b02:	c3                   	ret    

00800b03 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800b03:	f3 0f 1e fb          	endbr32 
  800b07:	55                   	push   %ebp
  800b08:	89 e5                	mov    %esp,%ebp
  800b0a:	57                   	push   %edi
  800b0b:	56                   	push   %esi
  800b0c:	53                   	push   %ebx
  800b0d:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b10:	b9 00 00 00 00       	mov    $0x0,%ecx
  800b15:	8b 55 08             	mov    0x8(%ebp),%edx
  800b18:	b8 03 00 00 00       	mov    $0x3,%eax
  800b1d:	89 cb                	mov    %ecx,%ebx
  800b1f:	89 cf                	mov    %ecx,%edi
  800b21:	89 ce                	mov    %ecx,%esi
  800b23:	cd 30                	int    $0x30
	if(check && ret > 0)
  800b25:	85 c0                	test   %eax,%eax
  800b27:	7f 08                	jg     800b31 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800b29:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800b2c:	5b                   	pop    %ebx
  800b2d:	5e                   	pop    %esi
  800b2e:	5f                   	pop    %edi
  800b2f:	5d                   	pop    %ebp
  800b30:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800b31:	83 ec 0c             	sub    $0xc,%esp
  800b34:	50                   	push   %eax
  800b35:	6a 03                	push   $0x3
  800b37:	68 1f 22 80 00       	push   $0x80221f
  800b3c:	6a 23                	push   $0x23
  800b3e:	68 3c 22 80 00       	push   $0x80223c
  800b43:	e8 9c 0f 00 00       	call   801ae4 <_panic>

00800b48 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800b48:	f3 0f 1e fb          	endbr32 
  800b4c:	55                   	push   %ebp
  800b4d:	89 e5                	mov    %esp,%ebp
  800b4f:	57                   	push   %edi
  800b50:	56                   	push   %esi
  800b51:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b52:	ba 00 00 00 00       	mov    $0x0,%edx
  800b57:	b8 02 00 00 00       	mov    $0x2,%eax
  800b5c:	89 d1                	mov    %edx,%ecx
  800b5e:	89 d3                	mov    %edx,%ebx
  800b60:	89 d7                	mov    %edx,%edi
  800b62:	89 d6                	mov    %edx,%esi
  800b64:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800b66:	5b                   	pop    %ebx
  800b67:	5e                   	pop    %esi
  800b68:	5f                   	pop    %edi
  800b69:	5d                   	pop    %ebp
  800b6a:	c3                   	ret    

00800b6b <sys_yield>:

void
sys_yield(void)
{
  800b6b:	f3 0f 1e fb          	endbr32 
  800b6f:	55                   	push   %ebp
  800b70:	89 e5                	mov    %esp,%ebp
  800b72:	57                   	push   %edi
  800b73:	56                   	push   %esi
  800b74:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b75:	ba 00 00 00 00       	mov    $0x0,%edx
  800b7a:	b8 0b 00 00 00       	mov    $0xb,%eax
  800b7f:	89 d1                	mov    %edx,%ecx
  800b81:	89 d3                	mov    %edx,%ebx
  800b83:	89 d7                	mov    %edx,%edi
  800b85:	89 d6                	mov    %edx,%esi
  800b87:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800b89:	5b                   	pop    %ebx
  800b8a:	5e                   	pop    %esi
  800b8b:	5f                   	pop    %edi
  800b8c:	5d                   	pop    %ebp
  800b8d:	c3                   	ret    

00800b8e <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800b8e:	f3 0f 1e fb          	endbr32 
  800b92:	55                   	push   %ebp
  800b93:	89 e5                	mov    %esp,%ebp
  800b95:	57                   	push   %edi
  800b96:	56                   	push   %esi
  800b97:	53                   	push   %ebx
  800b98:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b9b:	be 00 00 00 00       	mov    $0x0,%esi
  800ba0:	8b 55 08             	mov    0x8(%ebp),%edx
  800ba3:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ba6:	b8 04 00 00 00       	mov    $0x4,%eax
  800bab:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bae:	89 f7                	mov    %esi,%edi
  800bb0:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bb2:	85 c0                	test   %eax,%eax
  800bb4:	7f 08                	jg     800bbe <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800bb6:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bb9:	5b                   	pop    %ebx
  800bba:	5e                   	pop    %esi
  800bbb:	5f                   	pop    %edi
  800bbc:	5d                   	pop    %ebp
  800bbd:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bbe:	83 ec 0c             	sub    $0xc,%esp
  800bc1:	50                   	push   %eax
  800bc2:	6a 04                	push   $0x4
  800bc4:	68 1f 22 80 00       	push   $0x80221f
  800bc9:	6a 23                	push   $0x23
  800bcb:	68 3c 22 80 00       	push   $0x80223c
  800bd0:	e8 0f 0f 00 00       	call   801ae4 <_panic>

00800bd5 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800bd5:	f3 0f 1e fb          	endbr32 
  800bd9:	55                   	push   %ebp
  800bda:	89 e5                	mov    %esp,%ebp
  800bdc:	57                   	push   %edi
  800bdd:	56                   	push   %esi
  800bde:	53                   	push   %ebx
  800bdf:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800be2:	8b 55 08             	mov    0x8(%ebp),%edx
  800be5:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800be8:	b8 05 00 00 00       	mov    $0x5,%eax
  800bed:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bf0:	8b 7d 14             	mov    0x14(%ebp),%edi
  800bf3:	8b 75 18             	mov    0x18(%ebp),%esi
  800bf6:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bf8:	85 c0                	test   %eax,%eax
  800bfa:	7f 08                	jg     800c04 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800bfc:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bff:	5b                   	pop    %ebx
  800c00:	5e                   	pop    %esi
  800c01:	5f                   	pop    %edi
  800c02:	5d                   	pop    %ebp
  800c03:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c04:	83 ec 0c             	sub    $0xc,%esp
  800c07:	50                   	push   %eax
  800c08:	6a 05                	push   $0x5
  800c0a:	68 1f 22 80 00       	push   $0x80221f
  800c0f:	6a 23                	push   $0x23
  800c11:	68 3c 22 80 00       	push   $0x80223c
  800c16:	e8 c9 0e 00 00       	call   801ae4 <_panic>

00800c1b <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800c1b:	f3 0f 1e fb          	endbr32 
  800c1f:	55                   	push   %ebp
  800c20:	89 e5                	mov    %esp,%ebp
  800c22:	57                   	push   %edi
  800c23:	56                   	push   %esi
  800c24:	53                   	push   %ebx
  800c25:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c28:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c2d:	8b 55 08             	mov    0x8(%ebp),%edx
  800c30:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c33:	b8 06 00 00 00       	mov    $0x6,%eax
  800c38:	89 df                	mov    %ebx,%edi
  800c3a:	89 de                	mov    %ebx,%esi
  800c3c:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c3e:	85 c0                	test   %eax,%eax
  800c40:	7f 08                	jg     800c4a <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800c42:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c45:	5b                   	pop    %ebx
  800c46:	5e                   	pop    %esi
  800c47:	5f                   	pop    %edi
  800c48:	5d                   	pop    %ebp
  800c49:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c4a:	83 ec 0c             	sub    $0xc,%esp
  800c4d:	50                   	push   %eax
  800c4e:	6a 06                	push   $0x6
  800c50:	68 1f 22 80 00       	push   $0x80221f
  800c55:	6a 23                	push   $0x23
  800c57:	68 3c 22 80 00       	push   $0x80223c
  800c5c:	e8 83 0e 00 00       	call   801ae4 <_panic>

00800c61 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800c61:	f3 0f 1e fb          	endbr32 
  800c65:	55                   	push   %ebp
  800c66:	89 e5                	mov    %esp,%ebp
  800c68:	57                   	push   %edi
  800c69:	56                   	push   %esi
  800c6a:	53                   	push   %ebx
  800c6b:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c6e:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c73:	8b 55 08             	mov    0x8(%ebp),%edx
  800c76:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c79:	b8 08 00 00 00       	mov    $0x8,%eax
  800c7e:	89 df                	mov    %ebx,%edi
  800c80:	89 de                	mov    %ebx,%esi
  800c82:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c84:	85 c0                	test   %eax,%eax
  800c86:	7f 08                	jg     800c90 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800c88:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c8b:	5b                   	pop    %ebx
  800c8c:	5e                   	pop    %esi
  800c8d:	5f                   	pop    %edi
  800c8e:	5d                   	pop    %ebp
  800c8f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c90:	83 ec 0c             	sub    $0xc,%esp
  800c93:	50                   	push   %eax
  800c94:	6a 08                	push   $0x8
  800c96:	68 1f 22 80 00       	push   $0x80221f
  800c9b:	6a 23                	push   $0x23
  800c9d:	68 3c 22 80 00       	push   $0x80223c
  800ca2:	e8 3d 0e 00 00       	call   801ae4 <_panic>

00800ca7 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800ca7:	f3 0f 1e fb          	endbr32 
  800cab:	55                   	push   %ebp
  800cac:	89 e5                	mov    %esp,%ebp
  800cae:	57                   	push   %edi
  800caf:	56                   	push   %esi
  800cb0:	53                   	push   %ebx
  800cb1:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cb4:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cb9:	8b 55 08             	mov    0x8(%ebp),%edx
  800cbc:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cbf:	b8 09 00 00 00       	mov    $0x9,%eax
  800cc4:	89 df                	mov    %ebx,%edi
  800cc6:	89 de                	mov    %ebx,%esi
  800cc8:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cca:	85 c0                	test   %eax,%eax
  800ccc:	7f 08                	jg     800cd6 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800cce:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cd1:	5b                   	pop    %ebx
  800cd2:	5e                   	pop    %esi
  800cd3:	5f                   	pop    %edi
  800cd4:	5d                   	pop    %ebp
  800cd5:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cd6:	83 ec 0c             	sub    $0xc,%esp
  800cd9:	50                   	push   %eax
  800cda:	6a 09                	push   $0x9
  800cdc:	68 1f 22 80 00       	push   $0x80221f
  800ce1:	6a 23                	push   $0x23
  800ce3:	68 3c 22 80 00       	push   $0x80223c
  800ce8:	e8 f7 0d 00 00       	call   801ae4 <_panic>

00800ced <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800ced:	f3 0f 1e fb          	endbr32 
  800cf1:	55                   	push   %ebp
  800cf2:	89 e5                	mov    %esp,%ebp
  800cf4:	57                   	push   %edi
  800cf5:	56                   	push   %esi
  800cf6:	53                   	push   %ebx
  800cf7:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cfa:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cff:	8b 55 08             	mov    0x8(%ebp),%edx
  800d02:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d05:	b8 0a 00 00 00       	mov    $0xa,%eax
  800d0a:	89 df                	mov    %ebx,%edi
  800d0c:	89 de                	mov    %ebx,%esi
  800d0e:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d10:	85 c0                	test   %eax,%eax
  800d12:	7f 08                	jg     800d1c <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800d14:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d17:	5b                   	pop    %ebx
  800d18:	5e                   	pop    %esi
  800d19:	5f                   	pop    %edi
  800d1a:	5d                   	pop    %ebp
  800d1b:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d1c:	83 ec 0c             	sub    $0xc,%esp
  800d1f:	50                   	push   %eax
  800d20:	6a 0a                	push   $0xa
  800d22:	68 1f 22 80 00       	push   $0x80221f
  800d27:	6a 23                	push   $0x23
  800d29:	68 3c 22 80 00       	push   $0x80223c
  800d2e:	e8 b1 0d 00 00       	call   801ae4 <_panic>

00800d33 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800d33:	f3 0f 1e fb          	endbr32 
  800d37:	55                   	push   %ebp
  800d38:	89 e5                	mov    %esp,%ebp
  800d3a:	57                   	push   %edi
  800d3b:	56                   	push   %esi
  800d3c:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d3d:	8b 55 08             	mov    0x8(%ebp),%edx
  800d40:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d43:	b8 0c 00 00 00       	mov    $0xc,%eax
  800d48:	be 00 00 00 00       	mov    $0x0,%esi
  800d4d:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d50:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d53:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800d55:	5b                   	pop    %ebx
  800d56:	5e                   	pop    %esi
  800d57:	5f                   	pop    %edi
  800d58:	5d                   	pop    %ebp
  800d59:	c3                   	ret    

00800d5a <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800d5a:	f3 0f 1e fb          	endbr32 
  800d5e:	55                   	push   %ebp
  800d5f:	89 e5                	mov    %esp,%ebp
  800d61:	57                   	push   %edi
  800d62:	56                   	push   %esi
  800d63:	53                   	push   %ebx
  800d64:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d67:	b9 00 00 00 00       	mov    $0x0,%ecx
  800d6c:	8b 55 08             	mov    0x8(%ebp),%edx
  800d6f:	b8 0d 00 00 00       	mov    $0xd,%eax
  800d74:	89 cb                	mov    %ecx,%ebx
  800d76:	89 cf                	mov    %ecx,%edi
  800d78:	89 ce                	mov    %ecx,%esi
  800d7a:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d7c:	85 c0                	test   %eax,%eax
  800d7e:	7f 08                	jg     800d88 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800d80:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d83:	5b                   	pop    %ebx
  800d84:	5e                   	pop    %esi
  800d85:	5f                   	pop    %edi
  800d86:	5d                   	pop    %ebp
  800d87:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d88:	83 ec 0c             	sub    $0xc,%esp
  800d8b:	50                   	push   %eax
  800d8c:	6a 0d                	push   $0xd
  800d8e:	68 1f 22 80 00       	push   $0x80221f
  800d93:	6a 23                	push   $0x23
  800d95:	68 3c 22 80 00       	push   $0x80223c
  800d9a:	e8 45 0d 00 00       	call   801ae4 <_panic>

00800d9f <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800d9f:	f3 0f 1e fb          	endbr32 
  800da3:	55                   	push   %ebp
  800da4:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800da6:	8b 45 08             	mov    0x8(%ebp),%eax
  800da9:	05 00 00 00 30       	add    $0x30000000,%eax
  800dae:	c1 e8 0c             	shr    $0xc,%eax
}
  800db1:	5d                   	pop    %ebp
  800db2:	c3                   	ret    

00800db3 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800db3:	f3 0f 1e fb          	endbr32 
  800db7:	55                   	push   %ebp
  800db8:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800dba:	8b 45 08             	mov    0x8(%ebp),%eax
  800dbd:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800dc2:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800dc7:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800dcc:	5d                   	pop    %ebp
  800dcd:	c3                   	ret    

00800dce <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800dce:	f3 0f 1e fb          	endbr32 
  800dd2:	55                   	push   %ebp
  800dd3:	89 e5                	mov    %esp,%ebp
  800dd5:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800dda:	89 c2                	mov    %eax,%edx
  800ddc:	c1 ea 16             	shr    $0x16,%edx
  800ddf:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800de6:	f6 c2 01             	test   $0x1,%dl
  800de9:	74 2d                	je     800e18 <fd_alloc+0x4a>
  800deb:	89 c2                	mov    %eax,%edx
  800ded:	c1 ea 0c             	shr    $0xc,%edx
  800df0:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800df7:	f6 c2 01             	test   $0x1,%dl
  800dfa:	74 1c                	je     800e18 <fd_alloc+0x4a>
  800dfc:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800e01:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800e06:	75 d2                	jne    800dda <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800e08:	8b 45 08             	mov    0x8(%ebp),%eax
  800e0b:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800e11:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800e16:	eb 0a                	jmp    800e22 <fd_alloc+0x54>
			*fd_store = fd;
  800e18:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e1b:	89 01                	mov    %eax,(%ecx)
			return 0;
  800e1d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e22:	5d                   	pop    %ebp
  800e23:	c3                   	ret    

00800e24 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800e24:	f3 0f 1e fb          	endbr32 
  800e28:	55                   	push   %ebp
  800e29:	89 e5                	mov    %esp,%ebp
  800e2b:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800e2e:	83 f8 1f             	cmp    $0x1f,%eax
  800e31:	77 30                	ja     800e63 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800e33:	c1 e0 0c             	shl    $0xc,%eax
  800e36:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800e3b:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800e41:	f6 c2 01             	test   $0x1,%dl
  800e44:	74 24                	je     800e6a <fd_lookup+0x46>
  800e46:	89 c2                	mov    %eax,%edx
  800e48:	c1 ea 0c             	shr    $0xc,%edx
  800e4b:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e52:	f6 c2 01             	test   $0x1,%dl
  800e55:	74 1a                	je     800e71 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800e57:	8b 55 0c             	mov    0xc(%ebp),%edx
  800e5a:	89 02                	mov    %eax,(%edx)
	return 0;
  800e5c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e61:	5d                   	pop    %ebp
  800e62:	c3                   	ret    
		return -E_INVAL;
  800e63:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e68:	eb f7                	jmp    800e61 <fd_lookup+0x3d>
		return -E_INVAL;
  800e6a:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e6f:	eb f0                	jmp    800e61 <fd_lookup+0x3d>
  800e71:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e76:	eb e9                	jmp    800e61 <fd_lookup+0x3d>

00800e78 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800e78:	f3 0f 1e fb          	endbr32 
  800e7c:	55                   	push   %ebp
  800e7d:	89 e5                	mov    %esp,%ebp
  800e7f:	83 ec 08             	sub    $0x8,%esp
  800e82:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e85:	ba c8 22 80 00       	mov    $0x8022c8,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800e8a:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800e8f:	39 08                	cmp    %ecx,(%eax)
  800e91:	74 33                	je     800ec6 <dev_lookup+0x4e>
  800e93:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800e96:	8b 02                	mov    (%edx),%eax
  800e98:	85 c0                	test   %eax,%eax
  800e9a:	75 f3                	jne    800e8f <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800e9c:	a1 08 40 80 00       	mov    0x804008,%eax
  800ea1:	8b 40 48             	mov    0x48(%eax),%eax
  800ea4:	83 ec 04             	sub    $0x4,%esp
  800ea7:	51                   	push   %ecx
  800ea8:	50                   	push   %eax
  800ea9:	68 4c 22 80 00       	push   $0x80224c
  800eae:	e8 c0 f2 ff ff       	call   800173 <cprintf>
	*dev = 0;
  800eb3:	8b 45 0c             	mov    0xc(%ebp),%eax
  800eb6:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800ebc:	83 c4 10             	add    $0x10,%esp
  800ebf:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800ec4:	c9                   	leave  
  800ec5:	c3                   	ret    
			*dev = devtab[i];
  800ec6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ec9:	89 01                	mov    %eax,(%ecx)
			return 0;
  800ecb:	b8 00 00 00 00       	mov    $0x0,%eax
  800ed0:	eb f2                	jmp    800ec4 <dev_lookup+0x4c>

00800ed2 <fd_close>:
{
  800ed2:	f3 0f 1e fb          	endbr32 
  800ed6:	55                   	push   %ebp
  800ed7:	89 e5                	mov    %esp,%ebp
  800ed9:	57                   	push   %edi
  800eda:	56                   	push   %esi
  800edb:	53                   	push   %ebx
  800edc:	83 ec 24             	sub    $0x24,%esp
  800edf:	8b 75 08             	mov    0x8(%ebp),%esi
  800ee2:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ee5:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800ee8:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ee9:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800eef:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ef2:	50                   	push   %eax
  800ef3:	e8 2c ff ff ff       	call   800e24 <fd_lookup>
  800ef8:	89 c3                	mov    %eax,%ebx
  800efa:	83 c4 10             	add    $0x10,%esp
  800efd:	85 c0                	test   %eax,%eax
  800eff:	78 05                	js     800f06 <fd_close+0x34>
	    || fd != fd2)
  800f01:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800f04:	74 16                	je     800f1c <fd_close+0x4a>
		return (must_exist ? r : 0);
  800f06:	89 f8                	mov    %edi,%eax
  800f08:	84 c0                	test   %al,%al
  800f0a:	b8 00 00 00 00       	mov    $0x0,%eax
  800f0f:	0f 44 d8             	cmove  %eax,%ebx
}
  800f12:	89 d8                	mov    %ebx,%eax
  800f14:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f17:	5b                   	pop    %ebx
  800f18:	5e                   	pop    %esi
  800f19:	5f                   	pop    %edi
  800f1a:	5d                   	pop    %ebp
  800f1b:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  800f1c:	83 ec 08             	sub    $0x8,%esp
  800f1f:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800f22:	50                   	push   %eax
  800f23:	ff 36                	pushl  (%esi)
  800f25:	e8 4e ff ff ff       	call   800e78 <dev_lookup>
  800f2a:	89 c3                	mov    %eax,%ebx
  800f2c:	83 c4 10             	add    $0x10,%esp
  800f2f:	85 c0                	test   %eax,%eax
  800f31:	78 1a                	js     800f4d <fd_close+0x7b>
		if (dev->dev_close)
  800f33:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800f36:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  800f39:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  800f3e:	85 c0                	test   %eax,%eax
  800f40:	74 0b                	je     800f4d <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800f42:	83 ec 0c             	sub    $0xc,%esp
  800f45:	56                   	push   %esi
  800f46:	ff d0                	call   *%eax
  800f48:	89 c3                	mov    %eax,%ebx
  800f4a:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  800f4d:	83 ec 08             	sub    $0x8,%esp
  800f50:	56                   	push   %esi
  800f51:	6a 00                	push   $0x0
  800f53:	e8 c3 fc ff ff       	call   800c1b <sys_page_unmap>
	return r;
  800f58:	83 c4 10             	add    $0x10,%esp
  800f5b:	eb b5                	jmp    800f12 <fd_close+0x40>

00800f5d <close>:

int
close(int fdnum)
{
  800f5d:	f3 0f 1e fb          	endbr32 
  800f61:	55                   	push   %ebp
  800f62:	89 e5                	mov    %esp,%ebp
  800f64:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800f67:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800f6a:	50                   	push   %eax
  800f6b:	ff 75 08             	pushl  0x8(%ebp)
  800f6e:	e8 b1 fe ff ff       	call   800e24 <fd_lookup>
  800f73:	83 c4 10             	add    $0x10,%esp
  800f76:	85 c0                	test   %eax,%eax
  800f78:	79 02                	jns    800f7c <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  800f7a:	c9                   	leave  
  800f7b:	c3                   	ret    
		return fd_close(fd, 1);
  800f7c:	83 ec 08             	sub    $0x8,%esp
  800f7f:	6a 01                	push   $0x1
  800f81:	ff 75 f4             	pushl  -0xc(%ebp)
  800f84:	e8 49 ff ff ff       	call   800ed2 <fd_close>
  800f89:	83 c4 10             	add    $0x10,%esp
  800f8c:	eb ec                	jmp    800f7a <close+0x1d>

00800f8e <close_all>:

void
close_all(void)
{
  800f8e:	f3 0f 1e fb          	endbr32 
  800f92:	55                   	push   %ebp
  800f93:	89 e5                	mov    %esp,%ebp
  800f95:	53                   	push   %ebx
  800f96:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  800f99:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  800f9e:	83 ec 0c             	sub    $0xc,%esp
  800fa1:	53                   	push   %ebx
  800fa2:	e8 b6 ff ff ff       	call   800f5d <close>
	for (i = 0; i < MAXFD; i++)
  800fa7:	83 c3 01             	add    $0x1,%ebx
  800faa:	83 c4 10             	add    $0x10,%esp
  800fad:	83 fb 20             	cmp    $0x20,%ebx
  800fb0:	75 ec                	jne    800f9e <close_all+0x10>
}
  800fb2:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800fb5:	c9                   	leave  
  800fb6:	c3                   	ret    

00800fb7 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  800fb7:	f3 0f 1e fb          	endbr32 
  800fbb:	55                   	push   %ebp
  800fbc:	89 e5                	mov    %esp,%ebp
  800fbe:	57                   	push   %edi
  800fbf:	56                   	push   %esi
  800fc0:	53                   	push   %ebx
  800fc1:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  800fc4:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800fc7:	50                   	push   %eax
  800fc8:	ff 75 08             	pushl  0x8(%ebp)
  800fcb:	e8 54 fe ff ff       	call   800e24 <fd_lookup>
  800fd0:	89 c3                	mov    %eax,%ebx
  800fd2:	83 c4 10             	add    $0x10,%esp
  800fd5:	85 c0                	test   %eax,%eax
  800fd7:	0f 88 81 00 00 00    	js     80105e <dup+0xa7>
		return r;
	close(newfdnum);
  800fdd:	83 ec 0c             	sub    $0xc,%esp
  800fe0:	ff 75 0c             	pushl  0xc(%ebp)
  800fe3:	e8 75 ff ff ff       	call   800f5d <close>

	newfd = INDEX2FD(newfdnum);
  800fe8:	8b 75 0c             	mov    0xc(%ebp),%esi
  800feb:	c1 e6 0c             	shl    $0xc,%esi
  800fee:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  800ff4:	83 c4 04             	add    $0x4,%esp
  800ff7:	ff 75 e4             	pushl  -0x1c(%ebp)
  800ffa:	e8 b4 fd ff ff       	call   800db3 <fd2data>
  800fff:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  801001:	89 34 24             	mov    %esi,(%esp)
  801004:	e8 aa fd ff ff       	call   800db3 <fd2data>
  801009:	83 c4 10             	add    $0x10,%esp
  80100c:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  80100e:	89 d8                	mov    %ebx,%eax
  801010:	c1 e8 16             	shr    $0x16,%eax
  801013:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  80101a:	a8 01                	test   $0x1,%al
  80101c:	74 11                	je     80102f <dup+0x78>
  80101e:	89 d8                	mov    %ebx,%eax
  801020:	c1 e8 0c             	shr    $0xc,%eax
  801023:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  80102a:	f6 c2 01             	test   $0x1,%dl
  80102d:	75 39                	jne    801068 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80102f:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801032:	89 d0                	mov    %edx,%eax
  801034:	c1 e8 0c             	shr    $0xc,%eax
  801037:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80103e:	83 ec 0c             	sub    $0xc,%esp
  801041:	25 07 0e 00 00       	and    $0xe07,%eax
  801046:	50                   	push   %eax
  801047:	56                   	push   %esi
  801048:	6a 00                	push   $0x0
  80104a:	52                   	push   %edx
  80104b:	6a 00                	push   $0x0
  80104d:	e8 83 fb ff ff       	call   800bd5 <sys_page_map>
  801052:	89 c3                	mov    %eax,%ebx
  801054:	83 c4 20             	add    $0x20,%esp
  801057:	85 c0                	test   %eax,%eax
  801059:	78 31                	js     80108c <dup+0xd5>
		goto err;

	return newfdnum;
  80105b:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  80105e:	89 d8                	mov    %ebx,%eax
  801060:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801063:	5b                   	pop    %ebx
  801064:	5e                   	pop    %esi
  801065:	5f                   	pop    %edi
  801066:	5d                   	pop    %ebp
  801067:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801068:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80106f:	83 ec 0c             	sub    $0xc,%esp
  801072:	25 07 0e 00 00       	and    $0xe07,%eax
  801077:	50                   	push   %eax
  801078:	57                   	push   %edi
  801079:	6a 00                	push   $0x0
  80107b:	53                   	push   %ebx
  80107c:	6a 00                	push   $0x0
  80107e:	e8 52 fb ff ff       	call   800bd5 <sys_page_map>
  801083:	89 c3                	mov    %eax,%ebx
  801085:	83 c4 20             	add    $0x20,%esp
  801088:	85 c0                	test   %eax,%eax
  80108a:	79 a3                	jns    80102f <dup+0x78>
	sys_page_unmap(0, newfd);
  80108c:	83 ec 08             	sub    $0x8,%esp
  80108f:	56                   	push   %esi
  801090:	6a 00                	push   $0x0
  801092:	e8 84 fb ff ff       	call   800c1b <sys_page_unmap>
	sys_page_unmap(0, nva);
  801097:	83 c4 08             	add    $0x8,%esp
  80109a:	57                   	push   %edi
  80109b:	6a 00                	push   $0x0
  80109d:	e8 79 fb ff ff       	call   800c1b <sys_page_unmap>
	return r;
  8010a2:	83 c4 10             	add    $0x10,%esp
  8010a5:	eb b7                	jmp    80105e <dup+0xa7>

008010a7 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8010a7:	f3 0f 1e fb          	endbr32 
  8010ab:	55                   	push   %ebp
  8010ac:	89 e5                	mov    %esp,%ebp
  8010ae:	53                   	push   %ebx
  8010af:	83 ec 1c             	sub    $0x1c,%esp
  8010b2:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8010b5:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8010b8:	50                   	push   %eax
  8010b9:	53                   	push   %ebx
  8010ba:	e8 65 fd ff ff       	call   800e24 <fd_lookup>
  8010bf:	83 c4 10             	add    $0x10,%esp
  8010c2:	85 c0                	test   %eax,%eax
  8010c4:	78 3f                	js     801105 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8010c6:	83 ec 08             	sub    $0x8,%esp
  8010c9:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010cc:	50                   	push   %eax
  8010cd:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8010d0:	ff 30                	pushl  (%eax)
  8010d2:	e8 a1 fd ff ff       	call   800e78 <dev_lookup>
  8010d7:	83 c4 10             	add    $0x10,%esp
  8010da:	85 c0                	test   %eax,%eax
  8010dc:	78 27                	js     801105 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8010de:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8010e1:	8b 42 08             	mov    0x8(%edx),%eax
  8010e4:	83 e0 03             	and    $0x3,%eax
  8010e7:	83 f8 01             	cmp    $0x1,%eax
  8010ea:	74 1e                	je     80110a <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  8010ec:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8010ef:	8b 40 08             	mov    0x8(%eax),%eax
  8010f2:	85 c0                	test   %eax,%eax
  8010f4:	74 35                	je     80112b <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  8010f6:	83 ec 04             	sub    $0x4,%esp
  8010f9:	ff 75 10             	pushl  0x10(%ebp)
  8010fc:	ff 75 0c             	pushl  0xc(%ebp)
  8010ff:	52                   	push   %edx
  801100:	ff d0                	call   *%eax
  801102:	83 c4 10             	add    $0x10,%esp
}
  801105:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801108:	c9                   	leave  
  801109:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  80110a:	a1 08 40 80 00       	mov    0x804008,%eax
  80110f:	8b 40 48             	mov    0x48(%eax),%eax
  801112:	83 ec 04             	sub    $0x4,%esp
  801115:	53                   	push   %ebx
  801116:	50                   	push   %eax
  801117:	68 8d 22 80 00       	push   $0x80228d
  80111c:	e8 52 f0 ff ff       	call   800173 <cprintf>
		return -E_INVAL;
  801121:	83 c4 10             	add    $0x10,%esp
  801124:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801129:	eb da                	jmp    801105 <read+0x5e>
		return -E_NOT_SUPP;
  80112b:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801130:	eb d3                	jmp    801105 <read+0x5e>

00801132 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801132:	f3 0f 1e fb          	endbr32 
  801136:	55                   	push   %ebp
  801137:	89 e5                	mov    %esp,%ebp
  801139:	57                   	push   %edi
  80113a:	56                   	push   %esi
  80113b:	53                   	push   %ebx
  80113c:	83 ec 0c             	sub    $0xc,%esp
  80113f:	8b 7d 08             	mov    0x8(%ebp),%edi
  801142:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801145:	bb 00 00 00 00       	mov    $0x0,%ebx
  80114a:	eb 02                	jmp    80114e <readn+0x1c>
  80114c:	01 c3                	add    %eax,%ebx
  80114e:	39 f3                	cmp    %esi,%ebx
  801150:	73 21                	jae    801173 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801152:	83 ec 04             	sub    $0x4,%esp
  801155:	89 f0                	mov    %esi,%eax
  801157:	29 d8                	sub    %ebx,%eax
  801159:	50                   	push   %eax
  80115a:	89 d8                	mov    %ebx,%eax
  80115c:	03 45 0c             	add    0xc(%ebp),%eax
  80115f:	50                   	push   %eax
  801160:	57                   	push   %edi
  801161:	e8 41 ff ff ff       	call   8010a7 <read>
		if (m < 0)
  801166:	83 c4 10             	add    $0x10,%esp
  801169:	85 c0                	test   %eax,%eax
  80116b:	78 04                	js     801171 <readn+0x3f>
			return m;
		if (m == 0)
  80116d:	75 dd                	jne    80114c <readn+0x1a>
  80116f:	eb 02                	jmp    801173 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801171:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801173:	89 d8                	mov    %ebx,%eax
  801175:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801178:	5b                   	pop    %ebx
  801179:	5e                   	pop    %esi
  80117a:	5f                   	pop    %edi
  80117b:	5d                   	pop    %ebp
  80117c:	c3                   	ret    

0080117d <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  80117d:	f3 0f 1e fb          	endbr32 
  801181:	55                   	push   %ebp
  801182:	89 e5                	mov    %esp,%ebp
  801184:	53                   	push   %ebx
  801185:	83 ec 1c             	sub    $0x1c,%esp
  801188:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80118b:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80118e:	50                   	push   %eax
  80118f:	53                   	push   %ebx
  801190:	e8 8f fc ff ff       	call   800e24 <fd_lookup>
  801195:	83 c4 10             	add    $0x10,%esp
  801198:	85 c0                	test   %eax,%eax
  80119a:	78 3a                	js     8011d6 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80119c:	83 ec 08             	sub    $0x8,%esp
  80119f:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011a2:	50                   	push   %eax
  8011a3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011a6:	ff 30                	pushl  (%eax)
  8011a8:	e8 cb fc ff ff       	call   800e78 <dev_lookup>
  8011ad:	83 c4 10             	add    $0x10,%esp
  8011b0:	85 c0                	test   %eax,%eax
  8011b2:	78 22                	js     8011d6 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8011b4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011b7:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8011bb:	74 1e                	je     8011db <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8011bd:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8011c0:	8b 52 0c             	mov    0xc(%edx),%edx
  8011c3:	85 d2                	test   %edx,%edx
  8011c5:	74 35                	je     8011fc <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8011c7:	83 ec 04             	sub    $0x4,%esp
  8011ca:	ff 75 10             	pushl  0x10(%ebp)
  8011cd:	ff 75 0c             	pushl  0xc(%ebp)
  8011d0:	50                   	push   %eax
  8011d1:	ff d2                	call   *%edx
  8011d3:	83 c4 10             	add    $0x10,%esp
}
  8011d6:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8011d9:	c9                   	leave  
  8011da:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8011db:	a1 08 40 80 00       	mov    0x804008,%eax
  8011e0:	8b 40 48             	mov    0x48(%eax),%eax
  8011e3:	83 ec 04             	sub    $0x4,%esp
  8011e6:	53                   	push   %ebx
  8011e7:	50                   	push   %eax
  8011e8:	68 a9 22 80 00       	push   $0x8022a9
  8011ed:	e8 81 ef ff ff       	call   800173 <cprintf>
		return -E_INVAL;
  8011f2:	83 c4 10             	add    $0x10,%esp
  8011f5:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8011fa:	eb da                	jmp    8011d6 <write+0x59>
		return -E_NOT_SUPP;
  8011fc:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801201:	eb d3                	jmp    8011d6 <write+0x59>

00801203 <seek>:

int
seek(int fdnum, off_t offset)
{
  801203:	f3 0f 1e fb          	endbr32 
  801207:	55                   	push   %ebp
  801208:	89 e5                	mov    %esp,%ebp
  80120a:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80120d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801210:	50                   	push   %eax
  801211:	ff 75 08             	pushl  0x8(%ebp)
  801214:	e8 0b fc ff ff       	call   800e24 <fd_lookup>
  801219:	83 c4 10             	add    $0x10,%esp
  80121c:	85 c0                	test   %eax,%eax
  80121e:	78 0e                	js     80122e <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  801220:	8b 55 0c             	mov    0xc(%ebp),%edx
  801223:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801226:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801229:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80122e:	c9                   	leave  
  80122f:	c3                   	ret    

00801230 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  801230:	f3 0f 1e fb          	endbr32 
  801234:	55                   	push   %ebp
  801235:	89 e5                	mov    %esp,%ebp
  801237:	53                   	push   %ebx
  801238:	83 ec 1c             	sub    $0x1c,%esp
  80123b:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  80123e:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801241:	50                   	push   %eax
  801242:	53                   	push   %ebx
  801243:	e8 dc fb ff ff       	call   800e24 <fd_lookup>
  801248:	83 c4 10             	add    $0x10,%esp
  80124b:	85 c0                	test   %eax,%eax
  80124d:	78 37                	js     801286 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80124f:	83 ec 08             	sub    $0x8,%esp
  801252:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801255:	50                   	push   %eax
  801256:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801259:	ff 30                	pushl  (%eax)
  80125b:	e8 18 fc ff ff       	call   800e78 <dev_lookup>
  801260:	83 c4 10             	add    $0x10,%esp
  801263:	85 c0                	test   %eax,%eax
  801265:	78 1f                	js     801286 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801267:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80126a:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  80126e:	74 1b                	je     80128b <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  801270:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801273:	8b 52 18             	mov    0x18(%edx),%edx
  801276:	85 d2                	test   %edx,%edx
  801278:	74 32                	je     8012ac <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  80127a:	83 ec 08             	sub    $0x8,%esp
  80127d:	ff 75 0c             	pushl  0xc(%ebp)
  801280:	50                   	push   %eax
  801281:	ff d2                	call   *%edx
  801283:	83 c4 10             	add    $0x10,%esp
}
  801286:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801289:	c9                   	leave  
  80128a:	c3                   	ret    
			thisenv->env_id, fdnum);
  80128b:	a1 08 40 80 00       	mov    0x804008,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  801290:	8b 40 48             	mov    0x48(%eax),%eax
  801293:	83 ec 04             	sub    $0x4,%esp
  801296:	53                   	push   %ebx
  801297:	50                   	push   %eax
  801298:	68 6c 22 80 00       	push   $0x80226c
  80129d:	e8 d1 ee ff ff       	call   800173 <cprintf>
		return -E_INVAL;
  8012a2:	83 c4 10             	add    $0x10,%esp
  8012a5:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8012aa:	eb da                	jmp    801286 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8012ac:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8012b1:	eb d3                	jmp    801286 <ftruncate+0x56>

008012b3 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8012b3:	f3 0f 1e fb          	endbr32 
  8012b7:	55                   	push   %ebp
  8012b8:	89 e5                	mov    %esp,%ebp
  8012ba:	53                   	push   %ebx
  8012bb:	83 ec 1c             	sub    $0x1c,%esp
  8012be:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012c1:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012c4:	50                   	push   %eax
  8012c5:	ff 75 08             	pushl  0x8(%ebp)
  8012c8:	e8 57 fb ff ff       	call   800e24 <fd_lookup>
  8012cd:	83 c4 10             	add    $0x10,%esp
  8012d0:	85 c0                	test   %eax,%eax
  8012d2:	78 4b                	js     80131f <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012d4:	83 ec 08             	sub    $0x8,%esp
  8012d7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012da:	50                   	push   %eax
  8012db:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012de:	ff 30                	pushl  (%eax)
  8012e0:	e8 93 fb ff ff       	call   800e78 <dev_lookup>
  8012e5:	83 c4 10             	add    $0x10,%esp
  8012e8:	85 c0                	test   %eax,%eax
  8012ea:	78 33                	js     80131f <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  8012ec:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8012ef:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  8012f3:	74 2f                	je     801324 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  8012f5:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  8012f8:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  8012ff:	00 00 00 
	stat->st_isdir = 0;
  801302:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801309:	00 00 00 
	stat->st_dev = dev;
  80130c:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801312:	83 ec 08             	sub    $0x8,%esp
  801315:	53                   	push   %ebx
  801316:	ff 75 f0             	pushl  -0x10(%ebp)
  801319:	ff 50 14             	call   *0x14(%eax)
  80131c:	83 c4 10             	add    $0x10,%esp
}
  80131f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801322:	c9                   	leave  
  801323:	c3                   	ret    
		return -E_NOT_SUPP;
  801324:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801329:	eb f4                	jmp    80131f <fstat+0x6c>

0080132b <stat>:

int
stat(const char *path, struct Stat *stat)
{
  80132b:	f3 0f 1e fb          	endbr32 
  80132f:	55                   	push   %ebp
  801330:	89 e5                	mov    %esp,%ebp
  801332:	56                   	push   %esi
  801333:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  801334:	83 ec 08             	sub    $0x8,%esp
  801337:	6a 00                	push   $0x0
  801339:	ff 75 08             	pushl  0x8(%ebp)
  80133c:	e8 fb 01 00 00       	call   80153c <open>
  801341:	89 c3                	mov    %eax,%ebx
  801343:	83 c4 10             	add    $0x10,%esp
  801346:	85 c0                	test   %eax,%eax
  801348:	78 1b                	js     801365 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  80134a:	83 ec 08             	sub    $0x8,%esp
  80134d:	ff 75 0c             	pushl  0xc(%ebp)
  801350:	50                   	push   %eax
  801351:	e8 5d ff ff ff       	call   8012b3 <fstat>
  801356:	89 c6                	mov    %eax,%esi
	close(fd);
  801358:	89 1c 24             	mov    %ebx,(%esp)
  80135b:	e8 fd fb ff ff       	call   800f5d <close>
	return r;
  801360:	83 c4 10             	add    $0x10,%esp
  801363:	89 f3                	mov    %esi,%ebx
}
  801365:	89 d8                	mov    %ebx,%eax
  801367:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80136a:	5b                   	pop    %ebx
  80136b:	5e                   	pop    %esi
  80136c:	5d                   	pop    %ebp
  80136d:	c3                   	ret    

0080136e <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  80136e:	55                   	push   %ebp
  80136f:	89 e5                	mov    %esp,%ebp
  801371:	56                   	push   %esi
  801372:	53                   	push   %ebx
  801373:	89 c6                	mov    %eax,%esi
  801375:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801377:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  80137e:	74 27                	je     8013a7 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  801380:	6a 07                	push   $0x7
  801382:	68 00 50 80 00       	push   $0x805000
  801387:	56                   	push   %esi
  801388:	ff 35 00 40 80 00    	pushl  0x804000
  80138e:	e8 1c 08 00 00       	call   801baf <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  801393:	83 c4 0c             	add    $0xc,%esp
  801396:	6a 00                	push   $0x0
  801398:	53                   	push   %ebx
  801399:	6a 00                	push   $0x0
  80139b:	e8 8e 07 00 00       	call   801b2e <ipc_recv>
}
  8013a0:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8013a3:	5b                   	pop    %ebx
  8013a4:	5e                   	pop    %esi
  8013a5:	5d                   	pop    %ebp
  8013a6:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8013a7:	83 ec 0c             	sub    $0xc,%esp
  8013aa:	6a 01                	push   $0x1
  8013ac:	e8 56 08 00 00       	call   801c07 <ipc_find_env>
  8013b1:	a3 00 40 80 00       	mov    %eax,0x804000
  8013b6:	83 c4 10             	add    $0x10,%esp
  8013b9:	eb c5                	jmp    801380 <fsipc+0x12>

008013bb <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8013bb:	f3 0f 1e fb          	endbr32 
  8013bf:	55                   	push   %ebp
  8013c0:	89 e5                	mov    %esp,%ebp
  8013c2:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8013c5:	8b 45 08             	mov    0x8(%ebp),%eax
  8013c8:	8b 40 0c             	mov    0xc(%eax),%eax
  8013cb:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  8013d0:	8b 45 0c             	mov    0xc(%ebp),%eax
  8013d3:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8013d8:	ba 00 00 00 00       	mov    $0x0,%edx
  8013dd:	b8 02 00 00 00       	mov    $0x2,%eax
  8013e2:	e8 87 ff ff ff       	call   80136e <fsipc>
}
  8013e7:	c9                   	leave  
  8013e8:	c3                   	ret    

008013e9 <devfile_flush>:
{
  8013e9:	f3 0f 1e fb          	endbr32 
  8013ed:	55                   	push   %ebp
  8013ee:	89 e5                	mov    %esp,%ebp
  8013f0:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  8013f3:	8b 45 08             	mov    0x8(%ebp),%eax
  8013f6:	8b 40 0c             	mov    0xc(%eax),%eax
  8013f9:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  8013fe:	ba 00 00 00 00       	mov    $0x0,%edx
  801403:	b8 06 00 00 00       	mov    $0x6,%eax
  801408:	e8 61 ff ff ff       	call   80136e <fsipc>
}
  80140d:	c9                   	leave  
  80140e:	c3                   	ret    

0080140f <devfile_stat>:
{
  80140f:	f3 0f 1e fb          	endbr32 
  801413:	55                   	push   %ebp
  801414:	89 e5                	mov    %esp,%ebp
  801416:	53                   	push   %ebx
  801417:	83 ec 04             	sub    $0x4,%esp
  80141a:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  80141d:	8b 45 08             	mov    0x8(%ebp),%eax
  801420:	8b 40 0c             	mov    0xc(%eax),%eax
  801423:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801428:	ba 00 00 00 00       	mov    $0x0,%edx
  80142d:	b8 05 00 00 00       	mov    $0x5,%eax
  801432:	e8 37 ff ff ff       	call   80136e <fsipc>
  801437:	85 c0                	test   %eax,%eax
  801439:	78 2c                	js     801467 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  80143b:	83 ec 08             	sub    $0x8,%esp
  80143e:	68 00 50 80 00       	push   $0x805000
  801443:	53                   	push   %ebx
  801444:	e8 03 f3 ff ff       	call   80074c <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801449:	a1 80 50 80 00       	mov    0x805080,%eax
  80144e:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  801454:	a1 84 50 80 00       	mov    0x805084,%eax
  801459:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80145f:	83 c4 10             	add    $0x10,%esp
  801462:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801467:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80146a:	c9                   	leave  
  80146b:	c3                   	ret    

0080146c <devfile_write>:
{
  80146c:	f3 0f 1e fb          	endbr32 
  801470:	55                   	push   %ebp
  801471:	89 e5                	mov    %esp,%ebp
  801473:	83 ec 0c             	sub    $0xc,%esp
  801476:	8b 45 10             	mov    0x10(%ebp),%eax
  801479:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  80147e:	ba f8 0f 00 00       	mov    $0xff8,%edx
  801483:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  801486:	8b 55 08             	mov    0x8(%ebp),%edx
  801489:	8b 52 0c             	mov    0xc(%edx),%edx
  80148c:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  801492:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  801497:	50                   	push   %eax
  801498:	ff 75 0c             	pushl  0xc(%ebp)
  80149b:	68 08 50 80 00       	push   $0x805008
  8014a0:	e8 5d f4 ff ff       	call   800902 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8014a5:	ba 00 00 00 00       	mov    $0x0,%edx
  8014aa:	b8 04 00 00 00       	mov    $0x4,%eax
  8014af:	e8 ba fe ff ff       	call   80136e <fsipc>
  8014b4:	c9                   	leave  
  8014b5:	c3                   	ret    

008014b6 <devfile_read>:
{
  8014b6:	f3 0f 1e fb          	endbr32 
  8014ba:	55                   	push   %ebp
  8014bb:	89 e5                	mov    %esp,%ebp
  8014bd:	56                   	push   %esi
  8014be:	53                   	push   %ebx
  8014bf:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8014c2:	8b 45 08             	mov    0x8(%ebp),%eax
  8014c5:	8b 40 0c             	mov    0xc(%eax),%eax
  8014c8:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  8014cd:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8014d3:	ba 00 00 00 00       	mov    $0x0,%edx
  8014d8:	b8 03 00 00 00       	mov    $0x3,%eax
  8014dd:	e8 8c fe ff ff       	call   80136e <fsipc>
  8014e2:	89 c3                	mov    %eax,%ebx
  8014e4:	85 c0                	test   %eax,%eax
  8014e6:	78 1f                	js     801507 <devfile_read+0x51>
	assert(r <= n);
  8014e8:	39 f0                	cmp    %esi,%eax
  8014ea:	77 24                	ja     801510 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  8014ec:	3d 00 10 00 00       	cmp    $0x1000,%eax
  8014f1:	7f 33                	jg     801526 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  8014f3:	83 ec 04             	sub    $0x4,%esp
  8014f6:	50                   	push   %eax
  8014f7:	68 00 50 80 00       	push   $0x805000
  8014fc:	ff 75 0c             	pushl  0xc(%ebp)
  8014ff:	e8 fe f3 ff ff       	call   800902 <memmove>
	return r;
  801504:	83 c4 10             	add    $0x10,%esp
}
  801507:	89 d8                	mov    %ebx,%eax
  801509:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80150c:	5b                   	pop    %ebx
  80150d:	5e                   	pop    %esi
  80150e:	5d                   	pop    %ebp
  80150f:	c3                   	ret    
	assert(r <= n);
  801510:	68 d8 22 80 00       	push   $0x8022d8
  801515:	68 df 22 80 00       	push   $0x8022df
  80151a:	6a 7c                	push   $0x7c
  80151c:	68 f4 22 80 00       	push   $0x8022f4
  801521:	e8 be 05 00 00       	call   801ae4 <_panic>
	assert(r <= PGSIZE);
  801526:	68 ff 22 80 00       	push   $0x8022ff
  80152b:	68 df 22 80 00       	push   $0x8022df
  801530:	6a 7d                	push   $0x7d
  801532:	68 f4 22 80 00       	push   $0x8022f4
  801537:	e8 a8 05 00 00       	call   801ae4 <_panic>

0080153c <open>:
{
  80153c:	f3 0f 1e fb          	endbr32 
  801540:	55                   	push   %ebp
  801541:	89 e5                	mov    %esp,%ebp
  801543:	56                   	push   %esi
  801544:	53                   	push   %ebx
  801545:	83 ec 1c             	sub    $0x1c,%esp
  801548:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  80154b:	56                   	push   %esi
  80154c:	e8 b8 f1 ff ff       	call   800709 <strlen>
  801551:	83 c4 10             	add    $0x10,%esp
  801554:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801559:	7f 6c                	jg     8015c7 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  80155b:	83 ec 0c             	sub    $0xc,%esp
  80155e:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801561:	50                   	push   %eax
  801562:	e8 67 f8 ff ff       	call   800dce <fd_alloc>
  801567:	89 c3                	mov    %eax,%ebx
  801569:	83 c4 10             	add    $0x10,%esp
  80156c:	85 c0                	test   %eax,%eax
  80156e:	78 3c                	js     8015ac <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  801570:	83 ec 08             	sub    $0x8,%esp
  801573:	56                   	push   %esi
  801574:	68 00 50 80 00       	push   $0x805000
  801579:	e8 ce f1 ff ff       	call   80074c <strcpy>
	fsipcbuf.open.req_omode = mode;
  80157e:	8b 45 0c             	mov    0xc(%ebp),%eax
  801581:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  801586:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801589:	b8 01 00 00 00       	mov    $0x1,%eax
  80158e:	e8 db fd ff ff       	call   80136e <fsipc>
  801593:	89 c3                	mov    %eax,%ebx
  801595:	83 c4 10             	add    $0x10,%esp
  801598:	85 c0                	test   %eax,%eax
  80159a:	78 19                	js     8015b5 <open+0x79>
	return fd2num(fd);
  80159c:	83 ec 0c             	sub    $0xc,%esp
  80159f:	ff 75 f4             	pushl  -0xc(%ebp)
  8015a2:	e8 f8 f7 ff ff       	call   800d9f <fd2num>
  8015a7:	89 c3                	mov    %eax,%ebx
  8015a9:	83 c4 10             	add    $0x10,%esp
}
  8015ac:	89 d8                	mov    %ebx,%eax
  8015ae:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8015b1:	5b                   	pop    %ebx
  8015b2:	5e                   	pop    %esi
  8015b3:	5d                   	pop    %ebp
  8015b4:	c3                   	ret    
		fd_close(fd, 0);
  8015b5:	83 ec 08             	sub    $0x8,%esp
  8015b8:	6a 00                	push   $0x0
  8015ba:	ff 75 f4             	pushl  -0xc(%ebp)
  8015bd:	e8 10 f9 ff ff       	call   800ed2 <fd_close>
		return r;
  8015c2:	83 c4 10             	add    $0x10,%esp
  8015c5:	eb e5                	jmp    8015ac <open+0x70>
		return -E_BAD_PATH;
  8015c7:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8015cc:	eb de                	jmp    8015ac <open+0x70>

008015ce <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8015ce:	f3 0f 1e fb          	endbr32 
  8015d2:	55                   	push   %ebp
  8015d3:	89 e5                	mov    %esp,%ebp
  8015d5:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8015d8:	ba 00 00 00 00       	mov    $0x0,%edx
  8015dd:	b8 08 00 00 00       	mov    $0x8,%eax
  8015e2:	e8 87 fd ff ff       	call   80136e <fsipc>
}
  8015e7:	c9                   	leave  
  8015e8:	c3                   	ret    

008015e9 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  8015e9:	f3 0f 1e fb          	endbr32 
  8015ed:	55                   	push   %ebp
  8015ee:	89 e5                	mov    %esp,%ebp
  8015f0:	56                   	push   %esi
  8015f1:	53                   	push   %ebx
  8015f2:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  8015f5:	83 ec 0c             	sub    $0xc,%esp
  8015f8:	ff 75 08             	pushl  0x8(%ebp)
  8015fb:	e8 b3 f7 ff ff       	call   800db3 <fd2data>
  801600:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801602:	83 c4 08             	add    $0x8,%esp
  801605:	68 0b 23 80 00       	push   $0x80230b
  80160a:	53                   	push   %ebx
  80160b:	e8 3c f1 ff ff       	call   80074c <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801610:	8b 46 04             	mov    0x4(%esi),%eax
  801613:	2b 06                	sub    (%esi),%eax
  801615:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  80161b:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801622:	00 00 00 
	stat->st_dev = &devpipe;
  801625:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  80162c:	30 80 00 
	return 0;
}
  80162f:	b8 00 00 00 00       	mov    $0x0,%eax
  801634:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801637:	5b                   	pop    %ebx
  801638:	5e                   	pop    %esi
  801639:	5d                   	pop    %ebp
  80163a:	c3                   	ret    

0080163b <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  80163b:	f3 0f 1e fb          	endbr32 
  80163f:	55                   	push   %ebp
  801640:	89 e5                	mov    %esp,%ebp
  801642:	53                   	push   %ebx
  801643:	83 ec 0c             	sub    $0xc,%esp
  801646:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801649:	53                   	push   %ebx
  80164a:	6a 00                	push   $0x0
  80164c:	e8 ca f5 ff ff       	call   800c1b <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  801651:	89 1c 24             	mov    %ebx,(%esp)
  801654:	e8 5a f7 ff ff       	call   800db3 <fd2data>
  801659:	83 c4 08             	add    $0x8,%esp
  80165c:	50                   	push   %eax
  80165d:	6a 00                	push   $0x0
  80165f:	e8 b7 f5 ff ff       	call   800c1b <sys_page_unmap>
}
  801664:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801667:	c9                   	leave  
  801668:	c3                   	ret    

00801669 <_pipeisclosed>:
{
  801669:	55                   	push   %ebp
  80166a:	89 e5                	mov    %esp,%ebp
  80166c:	57                   	push   %edi
  80166d:	56                   	push   %esi
  80166e:	53                   	push   %ebx
  80166f:	83 ec 1c             	sub    $0x1c,%esp
  801672:	89 c7                	mov    %eax,%edi
  801674:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  801676:	a1 08 40 80 00       	mov    0x804008,%eax
  80167b:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  80167e:	83 ec 0c             	sub    $0xc,%esp
  801681:	57                   	push   %edi
  801682:	e8 bd 05 00 00       	call   801c44 <pageref>
  801687:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80168a:	89 34 24             	mov    %esi,(%esp)
  80168d:	e8 b2 05 00 00       	call   801c44 <pageref>
		nn = thisenv->env_runs;
  801692:	8b 15 08 40 80 00    	mov    0x804008,%edx
  801698:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  80169b:	83 c4 10             	add    $0x10,%esp
  80169e:	39 cb                	cmp    %ecx,%ebx
  8016a0:	74 1b                	je     8016bd <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8016a2:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016a5:	75 cf                	jne    801676 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8016a7:	8b 42 58             	mov    0x58(%edx),%eax
  8016aa:	6a 01                	push   $0x1
  8016ac:	50                   	push   %eax
  8016ad:	53                   	push   %ebx
  8016ae:	68 12 23 80 00       	push   $0x802312
  8016b3:	e8 bb ea ff ff       	call   800173 <cprintf>
  8016b8:	83 c4 10             	add    $0x10,%esp
  8016bb:	eb b9                	jmp    801676 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  8016bd:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016c0:	0f 94 c0             	sete   %al
  8016c3:	0f b6 c0             	movzbl %al,%eax
}
  8016c6:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8016c9:	5b                   	pop    %ebx
  8016ca:	5e                   	pop    %esi
  8016cb:	5f                   	pop    %edi
  8016cc:	5d                   	pop    %ebp
  8016cd:	c3                   	ret    

008016ce <devpipe_write>:
{
  8016ce:	f3 0f 1e fb          	endbr32 
  8016d2:	55                   	push   %ebp
  8016d3:	89 e5                	mov    %esp,%ebp
  8016d5:	57                   	push   %edi
  8016d6:	56                   	push   %esi
  8016d7:	53                   	push   %ebx
  8016d8:	83 ec 28             	sub    $0x28,%esp
  8016db:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  8016de:	56                   	push   %esi
  8016df:	e8 cf f6 ff ff       	call   800db3 <fd2data>
  8016e4:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8016e6:	83 c4 10             	add    $0x10,%esp
  8016e9:	bf 00 00 00 00       	mov    $0x0,%edi
  8016ee:	3b 7d 10             	cmp    0x10(%ebp),%edi
  8016f1:	74 4f                	je     801742 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  8016f3:	8b 43 04             	mov    0x4(%ebx),%eax
  8016f6:	8b 0b                	mov    (%ebx),%ecx
  8016f8:	8d 51 20             	lea    0x20(%ecx),%edx
  8016fb:	39 d0                	cmp    %edx,%eax
  8016fd:	72 14                	jb     801713 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  8016ff:	89 da                	mov    %ebx,%edx
  801701:	89 f0                	mov    %esi,%eax
  801703:	e8 61 ff ff ff       	call   801669 <_pipeisclosed>
  801708:	85 c0                	test   %eax,%eax
  80170a:	75 3b                	jne    801747 <devpipe_write+0x79>
			sys_yield();
  80170c:	e8 5a f4 ff ff       	call   800b6b <sys_yield>
  801711:	eb e0                	jmp    8016f3 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801713:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801716:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  80171a:	88 4d e7             	mov    %cl,-0x19(%ebp)
  80171d:	89 c2                	mov    %eax,%edx
  80171f:	c1 fa 1f             	sar    $0x1f,%edx
  801722:	89 d1                	mov    %edx,%ecx
  801724:	c1 e9 1b             	shr    $0x1b,%ecx
  801727:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  80172a:	83 e2 1f             	and    $0x1f,%edx
  80172d:	29 ca                	sub    %ecx,%edx
  80172f:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801733:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801737:	83 c0 01             	add    $0x1,%eax
  80173a:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  80173d:	83 c7 01             	add    $0x1,%edi
  801740:	eb ac                	jmp    8016ee <devpipe_write+0x20>
	return i;
  801742:	8b 45 10             	mov    0x10(%ebp),%eax
  801745:	eb 05                	jmp    80174c <devpipe_write+0x7e>
				return 0;
  801747:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80174c:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80174f:	5b                   	pop    %ebx
  801750:	5e                   	pop    %esi
  801751:	5f                   	pop    %edi
  801752:	5d                   	pop    %ebp
  801753:	c3                   	ret    

00801754 <devpipe_read>:
{
  801754:	f3 0f 1e fb          	endbr32 
  801758:	55                   	push   %ebp
  801759:	89 e5                	mov    %esp,%ebp
  80175b:	57                   	push   %edi
  80175c:	56                   	push   %esi
  80175d:	53                   	push   %ebx
  80175e:	83 ec 18             	sub    $0x18,%esp
  801761:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  801764:	57                   	push   %edi
  801765:	e8 49 f6 ff ff       	call   800db3 <fd2data>
  80176a:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80176c:	83 c4 10             	add    $0x10,%esp
  80176f:	be 00 00 00 00       	mov    $0x0,%esi
  801774:	3b 75 10             	cmp    0x10(%ebp),%esi
  801777:	75 14                	jne    80178d <devpipe_read+0x39>
	return i;
  801779:	8b 45 10             	mov    0x10(%ebp),%eax
  80177c:	eb 02                	jmp    801780 <devpipe_read+0x2c>
				return i;
  80177e:	89 f0                	mov    %esi,%eax
}
  801780:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801783:	5b                   	pop    %ebx
  801784:	5e                   	pop    %esi
  801785:	5f                   	pop    %edi
  801786:	5d                   	pop    %ebp
  801787:	c3                   	ret    
			sys_yield();
  801788:	e8 de f3 ff ff       	call   800b6b <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  80178d:	8b 03                	mov    (%ebx),%eax
  80178f:	3b 43 04             	cmp    0x4(%ebx),%eax
  801792:	75 18                	jne    8017ac <devpipe_read+0x58>
			if (i > 0)
  801794:	85 f6                	test   %esi,%esi
  801796:	75 e6                	jne    80177e <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  801798:	89 da                	mov    %ebx,%edx
  80179a:	89 f8                	mov    %edi,%eax
  80179c:	e8 c8 fe ff ff       	call   801669 <_pipeisclosed>
  8017a1:	85 c0                	test   %eax,%eax
  8017a3:	74 e3                	je     801788 <devpipe_read+0x34>
				return 0;
  8017a5:	b8 00 00 00 00       	mov    $0x0,%eax
  8017aa:	eb d4                	jmp    801780 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  8017ac:	99                   	cltd   
  8017ad:	c1 ea 1b             	shr    $0x1b,%edx
  8017b0:	01 d0                	add    %edx,%eax
  8017b2:	83 e0 1f             	and    $0x1f,%eax
  8017b5:	29 d0                	sub    %edx,%eax
  8017b7:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  8017bc:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017bf:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  8017c2:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  8017c5:	83 c6 01             	add    $0x1,%esi
  8017c8:	eb aa                	jmp    801774 <devpipe_read+0x20>

008017ca <pipe>:
{
  8017ca:	f3 0f 1e fb          	endbr32 
  8017ce:	55                   	push   %ebp
  8017cf:	89 e5                	mov    %esp,%ebp
  8017d1:	56                   	push   %esi
  8017d2:	53                   	push   %ebx
  8017d3:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  8017d6:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8017d9:	50                   	push   %eax
  8017da:	e8 ef f5 ff ff       	call   800dce <fd_alloc>
  8017df:	89 c3                	mov    %eax,%ebx
  8017e1:	83 c4 10             	add    $0x10,%esp
  8017e4:	85 c0                	test   %eax,%eax
  8017e6:	0f 88 23 01 00 00    	js     80190f <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8017ec:	83 ec 04             	sub    $0x4,%esp
  8017ef:	68 07 04 00 00       	push   $0x407
  8017f4:	ff 75 f4             	pushl  -0xc(%ebp)
  8017f7:	6a 00                	push   $0x0
  8017f9:	e8 90 f3 ff ff       	call   800b8e <sys_page_alloc>
  8017fe:	89 c3                	mov    %eax,%ebx
  801800:	83 c4 10             	add    $0x10,%esp
  801803:	85 c0                	test   %eax,%eax
  801805:	0f 88 04 01 00 00    	js     80190f <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  80180b:	83 ec 0c             	sub    $0xc,%esp
  80180e:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801811:	50                   	push   %eax
  801812:	e8 b7 f5 ff ff       	call   800dce <fd_alloc>
  801817:	89 c3                	mov    %eax,%ebx
  801819:	83 c4 10             	add    $0x10,%esp
  80181c:	85 c0                	test   %eax,%eax
  80181e:	0f 88 db 00 00 00    	js     8018ff <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801824:	83 ec 04             	sub    $0x4,%esp
  801827:	68 07 04 00 00       	push   $0x407
  80182c:	ff 75 f0             	pushl  -0x10(%ebp)
  80182f:	6a 00                	push   $0x0
  801831:	e8 58 f3 ff ff       	call   800b8e <sys_page_alloc>
  801836:	89 c3                	mov    %eax,%ebx
  801838:	83 c4 10             	add    $0x10,%esp
  80183b:	85 c0                	test   %eax,%eax
  80183d:	0f 88 bc 00 00 00    	js     8018ff <pipe+0x135>
	va = fd2data(fd0);
  801843:	83 ec 0c             	sub    $0xc,%esp
  801846:	ff 75 f4             	pushl  -0xc(%ebp)
  801849:	e8 65 f5 ff ff       	call   800db3 <fd2data>
  80184e:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801850:	83 c4 0c             	add    $0xc,%esp
  801853:	68 07 04 00 00       	push   $0x407
  801858:	50                   	push   %eax
  801859:	6a 00                	push   $0x0
  80185b:	e8 2e f3 ff ff       	call   800b8e <sys_page_alloc>
  801860:	89 c3                	mov    %eax,%ebx
  801862:	83 c4 10             	add    $0x10,%esp
  801865:	85 c0                	test   %eax,%eax
  801867:	0f 88 82 00 00 00    	js     8018ef <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80186d:	83 ec 0c             	sub    $0xc,%esp
  801870:	ff 75 f0             	pushl  -0x10(%ebp)
  801873:	e8 3b f5 ff ff       	call   800db3 <fd2data>
  801878:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  80187f:	50                   	push   %eax
  801880:	6a 00                	push   $0x0
  801882:	56                   	push   %esi
  801883:	6a 00                	push   $0x0
  801885:	e8 4b f3 ff ff       	call   800bd5 <sys_page_map>
  80188a:	89 c3                	mov    %eax,%ebx
  80188c:	83 c4 20             	add    $0x20,%esp
  80188f:	85 c0                	test   %eax,%eax
  801891:	78 4e                	js     8018e1 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801893:	a1 20 30 80 00       	mov    0x803020,%eax
  801898:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80189b:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  80189d:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8018a0:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  8018a7:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8018aa:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  8018ac:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8018af:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  8018b6:	83 ec 0c             	sub    $0xc,%esp
  8018b9:	ff 75 f4             	pushl  -0xc(%ebp)
  8018bc:	e8 de f4 ff ff       	call   800d9f <fd2num>
  8018c1:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018c4:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  8018c6:	83 c4 04             	add    $0x4,%esp
  8018c9:	ff 75 f0             	pushl  -0x10(%ebp)
  8018cc:	e8 ce f4 ff ff       	call   800d9f <fd2num>
  8018d1:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018d4:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  8018d7:	83 c4 10             	add    $0x10,%esp
  8018da:	bb 00 00 00 00       	mov    $0x0,%ebx
  8018df:	eb 2e                	jmp    80190f <pipe+0x145>
	sys_page_unmap(0, va);
  8018e1:	83 ec 08             	sub    $0x8,%esp
  8018e4:	56                   	push   %esi
  8018e5:	6a 00                	push   $0x0
  8018e7:	e8 2f f3 ff ff       	call   800c1b <sys_page_unmap>
  8018ec:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  8018ef:	83 ec 08             	sub    $0x8,%esp
  8018f2:	ff 75 f0             	pushl  -0x10(%ebp)
  8018f5:	6a 00                	push   $0x0
  8018f7:	e8 1f f3 ff ff       	call   800c1b <sys_page_unmap>
  8018fc:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  8018ff:	83 ec 08             	sub    $0x8,%esp
  801902:	ff 75 f4             	pushl  -0xc(%ebp)
  801905:	6a 00                	push   $0x0
  801907:	e8 0f f3 ff ff       	call   800c1b <sys_page_unmap>
  80190c:	83 c4 10             	add    $0x10,%esp
}
  80190f:	89 d8                	mov    %ebx,%eax
  801911:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801914:	5b                   	pop    %ebx
  801915:	5e                   	pop    %esi
  801916:	5d                   	pop    %ebp
  801917:	c3                   	ret    

00801918 <pipeisclosed>:
{
  801918:	f3 0f 1e fb          	endbr32 
  80191c:	55                   	push   %ebp
  80191d:	89 e5                	mov    %esp,%ebp
  80191f:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801922:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801925:	50                   	push   %eax
  801926:	ff 75 08             	pushl  0x8(%ebp)
  801929:	e8 f6 f4 ff ff       	call   800e24 <fd_lookup>
  80192e:	83 c4 10             	add    $0x10,%esp
  801931:	85 c0                	test   %eax,%eax
  801933:	78 18                	js     80194d <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801935:	83 ec 0c             	sub    $0xc,%esp
  801938:	ff 75 f4             	pushl  -0xc(%ebp)
  80193b:	e8 73 f4 ff ff       	call   800db3 <fd2data>
  801940:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801942:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801945:	e8 1f fd ff ff       	call   801669 <_pipeisclosed>
  80194a:	83 c4 10             	add    $0x10,%esp
}
  80194d:	c9                   	leave  
  80194e:	c3                   	ret    

0080194f <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  80194f:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801953:	b8 00 00 00 00       	mov    $0x0,%eax
  801958:	c3                   	ret    

00801959 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801959:	f3 0f 1e fb          	endbr32 
  80195d:	55                   	push   %ebp
  80195e:	89 e5                	mov    %esp,%ebp
  801960:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801963:	68 2a 23 80 00       	push   $0x80232a
  801968:	ff 75 0c             	pushl  0xc(%ebp)
  80196b:	e8 dc ed ff ff       	call   80074c <strcpy>
	return 0;
}
  801970:	b8 00 00 00 00       	mov    $0x0,%eax
  801975:	c9                   	leave  
  801976:	c3                   	ret    

00801977 <devcons_write>:
{
  801977:	f3 0f 1e fb          	endbr32 
  80197b:	55                   	push   %ebp
  80197c:	89 e5                	mov    %esp,%ebp
  80197e:	57                   	push   %edi
  80197f:	56                   	push   %esi
  801980:	53                   	push   %ebx
  801981:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801987:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  80198c:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801992:	3b 75 10             	cmp    0x10(%ebp),%esi
  801995:	73 31                	jae    8019c8 <devcons_write+0x51>
		m = n - tot;
  801997:	8b 5d 10             	mov    0x10(%ebp),%ebx
  80199a:	29 f3                	sub    %esi,%ebx
  80199c:	83 fb 7f             	cmp    $0x7f,%ebx
  80199f:	b8 7f 00 00 00       	mov    $0x7f,%eax
  8019a4:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  8019a7:	83 ec 04             	sub    $0x4,%esp
  8019aa:	53                   	push   %ebx
  8019ab:	89 f0                	mov    %esi,%eax
  8019ad:	03 45 0c             	add    0xc(%ebp),%eax
  8019b0:	50                   	push   %eax
  8019b1:	57                   	push   %edi
  8019b2:	e8 4b ef ff ff       	call   800902 <memmove>
		sys_cputs(buf, m);
  8019b7:	83 c4 08             	add    $0x8,%esp
  8019ba:	53                   	push   %ebx
  8019bb:	57                   	push   %edi
  8019bc:	e8 fd f0 ff ff       	call   800abe <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  8019c1:	01 de                	add    %ebx,%esi
  8019c3:	83 c4 10             	add    $0x10,%esp
  8019c6:	eb ca                	jmp    801992 <devcons_write+0x1b>
}
  8019c8:	89 f0                	mov    %esi,%eax
  8019ca:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8019cd:	5b                   	pop    %ebx
  8019ce:	5e                   	pop    %esi
  8019cf:	5f                   	pop    %edi
  8019d0:	5d                   	pop    %ebp
  8019d1:	c3                   	ret    

008019d2 <devcons_read>:
{
  8019d2:	f3 0f 1e fb          	endbr32 
  8019d6:	55                   	push   %ebp
  8019d7:	89 e5                	mov    %esp,%ebp
  8019d9:	83 ec 08             	sub    $0x8,%esp
  8019dc:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  8019e1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8019e5:	74 21                	je     801a08 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  8019e7:	e8 f4 f0 ff ff       	call   800ae0 <sys_cgetc>
  8019ec:	85 c0                	test   %eax,%eax
  8019ee:	75 07                	jne    8019f7 <devcons_read+0x25>
		sys_yield();
  8019f0:	e8 76 f1 ff ff       	call   800b6b <sys_yield>
  8019f5:	eb f0                	jmp    8019e7 <devcons_read+0x15>
	if (c < 0)
  8019f7:	78 0f                	js     801a08 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  8019f9:	83 f8 04             	cmp    $0x4,%eax
  8019fc:	74 0c                	je     801a0a <devcons_read+0x38>
	*(char*)vbuf = c;
  8019fe:	8b 55 0c             	mov    0xc(%ebp),%edx
  801a01:	88 02                	mov    %al,(%edx)
	return 1;
  801a03:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801a08:	c9                   	leave  
  801a09:	c3                   	ret    
		return 0;
  801a0a:	b8 00 00 00 00       	mov    $0x0,%eax
  801a0f:	eb f7                	jmp    801a08 <devcons_read+0x36>

00801a11 <cputchar>:
{
  801a11:	f3 0f 1e fb          	endbr32 
  801a15:	55                   	push   %ebp
  801a16:	89 e5                	mov    %esp,%ebp
  801a18:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801a1b:	8b 45 08             	mov    0x8(%ebp),%eax
  801a1e:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801a21:	6a 01                	push   $0x1
  801a23:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a26:	50                   	push   %eax
  801a27:	e8 92 f0 ff ff       	call   800abe <sys_cputs>
}
  801a2c:	83 c4 10             	add    $0x10,%esp
  801a2f:	c9                   	leave  
  801a30:	c3                   	ret    

00801a31 <getchar>:
{
  801a31:	f3 0f 1e fb          	endbr32 
  801a35:	55                   	push   %ebp
  801a36:	89 e5                	mov    %esp,%ebp
  801a38:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801a3b:	6a 01                	push   $0x1
  801a3d:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a40:	50                   	push   %eax
  801a41:	6a 00                	push   $0x0
  801a43:	e8 5f f6 ff ff       	call   8010a7 <read>
	if (r < 0)
  801a48:	83 c4 10             	add    $0x10,%esp
  801a4b:	85 c0                	test   %eax,%eax
  801a4d:	78 06                	js     801a55 <getchar+0x24>
	if (r < 1)
  801a4f:	74 06                	je     801a57 <getchar+0x26>
	return c;
  801a51:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801a55:	c9                   	leave  
  801a56:	c3                   	ret    
		return -E_EOF;
  801a57:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801a5c:	eb f7                	jmp    801a55 <getchar+0x24>

00801a5e <iscons>:
{
  801a5e:	f3 0f 1e fb          	endbr32 
  801a62:	55                   	push   %ebp
  801a63:	89 e5                	mov    %esp,%ebp
  801a65:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801a68:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a6b:	50                   	push   %eax
  801a6c:	ff 75 08             	pushl  0x8(%ebp)
  801a6f:	e8 b0 f3 ff ff       	call   800e24 <fd_lookup>
  801a74:	83 c4 10             	add    $0x10,%esp
  801a77:	85 c0                	test   %eax,%eax
  801a79:	78 11                	js     801a8c <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801a7b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a7e:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801a84:	39 10                	cmp    %edx,(%eax)
  801a86:	0f 94 c0             	sete   %al
  801a89:	0f b6 c0             	movzbl %al,%eax
}
  801a8c:	c9                   	leave  
  801a8d:	c3                   	ret    

00801a8e <opencons>:
{
  801a8e:	f3 0f 1e fb          	endbr32 
  801a92:	55                   	push   %ebp
  801a93:	89 e5                	mov    %esp,%ebp
  801a95:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801a98:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a9b:	50                   	push   %eax
  801a9c:	e8 2d f3 ff ff       	call   800dce <fd_alloc>
  801aa1:	83 c4 10             	add    $0x10,%esp
  801aa4:	85 c0                	test   %eax,%eax
  801aa6:	78 3a                	js     801ae2 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801aa8:	83 ec 04             	sub    $0x4,%esp
  801aab:	68 07 04 00 00       	push   $0x407
  801ab0:	ff 75 f4             	pushl  -0xc(%ebp)
  801ab3:	6a 00                	push   $0x0
  801ab5:	e8 d4 f0 ff ff       	call   800b8e <sys_page_alloc>
  801aba:	83 c4 10             	add    $0x10,%esp
  801abd:	85 c0                	test   %eax,%eax
  801abf:	78 21                	js     801ae2 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801ac1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801ac4:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801aca:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801acc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801acf:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801ad6:	83 ec 0c             	sub    $0xc,%esp
  801ad9:	50                   	push   %eax
  801ada:	e8 c0 f2 ff ff       	call   800d9f <fd2num>
  801adf:	83 c4 10             	add    $0x10,%esp
}
  801ae2:	c9                   	leave  
  801ae3:	c3                   	ret    

00801ae4 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801ae4:	f3 0f 1e fb          	endbr32 
  801ae8:	55                   	push   %ebp
  801ae9:	89 e5                	mov    %esp,%ebp
  801aeb:	56                   	push   %esi
  801aec:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801aed:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801af0:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801af6:	e8 4d f0 ff ff       	call   800b48 <sys_getenvid>
  801afb:	83 ec 0c             	sub    $0xc,%esp
  801afe:	ff 75 0c             	pushl  0xc(%ebp)
  801b01:	ff 75 08             	pushl  0x8(%ebp)
  801b04:	56                   	push   %esi
  801b05:	50                   	push   %eax
  801b06:	68 38 23 80 00       	push   $0x802338
  801b0b:	e8 63 e6 ff ff       	call   800173 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801b10:	83 c4 18             	add    $0x18,%esp
  801b13:	53                   	push   %ebx
  801b14:	ff 75 10             	pushl  0x10(%ebp)
  801b17:	e8 02 e6 ff ff       	call   80011e <vcprintf>
	cprintf("\n");
  801b1c:	c7 04 24 0c 1f 80 00 	movl   $0x801f0c,(%esp)
  801b23:	e8 4b e6 ff ff       	call   800173 <cprintf>
  801b28:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  801b2b:	cc                   	int3   
  801b2c:	eb fd                	jmp    801b2b <_panic+0x47>

00801b2e <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801b2e:	f3 0f 1e fb          	endbr32 
  801b32:	55                   	push   %ebp
  801b33:	89 e5                	mov    %esp,%ebp
  801b35:	56                   	push   %esi
  801b36:	53                   	push   %ebx
  801b37:	8b 75 08             	mov    0x8(%ebp),%esi
  801b3a:	8b 45 0c             	mov    0xc(%ebp),%eax
  801b3d:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801b40:	85 c0                	test   %eax,%eax
  801b42:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801b47:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801b4a:	83 ec 0c             	sub    $0xc,%esp
  801b4d:	50                   	push   %eax
  801b4e:	e8 07 f2 ff ff       	call   800d5a <sys_ipc_recv>
  801b53:	83 c4 10             	add    $0x10,%esp
  801b56:	85 c0                	test   %eax,%eax
  801b58:	78 3f                	js     801b99 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801b5a:	e8 e9 ef ff ff       	call   800b48 <sys_getenvid>
  801b5f:	25 ff 03 00 00       	and    $0x3ff,%eax
  801b64:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801b67:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801b6d:	89 15 08 40 80 00    	mov    %edx,0x804008

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801b73:	85 f6                	test   %esi,%esi
  801b75:	74 05                	je     801b7c <ipc_recv+0x4e>
  801b77:	8b 42 74             	mov    0x74(%edx),%eax
  801b7a:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801b7c:	85 db                	test   %ebx,%ebx
  801b7e:	74 0a                	je     801b8a <ipc_recv+0x5c>
  801b80:	a1 08 40 80 00       	mov    0x804008,%eax
  801b85:	8b 40 78             	mov    0x78(%eax),%eax
  801b88:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801b8a:	a1 08 40 80 00       	mov    0x804008,%eax
  801b8f:	8b 40 70             	mov    0x70(%eax),%eax
}
  801b92:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801b95:	5b                   	pop    %ebx
  801b96:	5e                   	pop    %esi
  801b97:	5d                   	pop    %ebp
  801b98:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801b99:	85 f6                	test   %esi,%esi
  801b9b:	74 06                	je     801ba3 <ipc_recv+0x75>
  801b9d:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801ba3:	85 db                	test   %ebx,%ebx
  801ba5:	74 eb                	je     801b92 <ipc_recv+0x64>
  801ba7:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801bad:	eb e3                	jmp    801b92 <ipc_recv+0x64>

00801baf <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801baf:	f3 0f 1e fb          	endbr32 
  801bb3:	55                   	push   %ebp
  801bb4:	89 e5                	mov    %esp,%ebp
  801bb6:	57                   	push   %edi
  801bb7:	56                   	push   %esi
  801bb8:	53                   	push   %ebx
  801bb9:	83 ec 0c             	sub    $0xc,%esp
  801bbc:	8b 7d 08             	mov    0x8(%ebp),%edi
  801bbf:	8b 75 0c             	mov    0xc(%ebp),%esi
  801bc2:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801bc5:	85 db                	test   %ebx,%ebx
  801bc7:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801bcc:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801bcf:	ff 75 14             	pushl  0x14(%ebp)
  801bd2:	53                   	push   %ebx
  801bd3:	56                   	push   %esi
  801bd4:	57                   	push   %edi
  801bd5:	e8 59 f1 ff ff       	call   800d33 <sys_ipc_try_send>
  801bda:	83 c4 10             	add    $0x10,%esp
  801bdd:	85 c0                	test   %eax,%eax
  801bdf:	79 1e                	jns    801bff <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801be1:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801be4:	75 07                	jne    801bed <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801be6:	e8 80 ef ff ff       	call   800b6b <sys_yield>
  801beb:	eb e2                	jmp    801bcf <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801bed:	50                   	push   %eax
  801bee:	68 5b 23 80 00       	push   $0x80235b
  801bf3:	6a 3b                	push   $0x3b
  801bf5:	68 6f 23 80 00       	push   $0x80236f
  801bfa:	e8 e5 fe ff ff       	call   801ae4 <_panic>
	}
}
  801bff:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c02:	5b                   	pop    %ebx
  801c03:	5e                   	pop    %esi
  801c04:	5f                   	pop    %edi
  801c05:	5d                   	pop    %ebp
  801c06:	c3                   	ret    

00801c07 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c07:	f3 0f 1e fb          	endbr32 
  801c0b:	55                   	push   %ebp
  801c0c:	89 e5                	mov    %esp,%ebp
  801c0e:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801c11:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c16:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c19:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c1f:	8b 52 50             	mov    0x50(%edx),%edx
  801c22:	39 ca                	cmp    %ecx,%edx
  801c24:	74 11                	je     801c37 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801c26:	83 c0 01             	add    $0x1,%eax
  801c29:	3d 00 04 00 00       	cmp    $0x400,%eax
  801c2e:	75 e6                	jne    801c16 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801c30:	b8 00 00 00 00       	mov    $0x0,%eax
  801c35:	eb 0b                	jmp    801c42 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801c37:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801c3a:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801c3f:	8b 40 48             	mov    0x48(%eax),%eax
}
  801c42:	5d                   	pop    %ebp
  801c43:	c3                   	ret    

00801c44 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801c44:	f3 0f 1e fb          	endbr32 
  801c48:	55                   	push   %ebp
  801c49:	89 e5                	mov    %esp,%ebp
  801c4b:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801c4e:	89 c2                	mov    %eax,%edx
  801c50:	c1 ea 16             	shr    $0x16,%edx
  801c53:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801c5a:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801c5f:	f6 c1 01             	test   $0x1,%cl
  801c62:	74 1c                	je     801c80 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801c64:	c1 e8 0c             	shr    $0xc,%eax
  801c67:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801c6e:	a8 01                	test   $0x1,%al
  801c70:	74 0e                	je     801c80 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801c72:	c1 e8 0c             	shr    $0xc,%eax
  801c75:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801c7c:	ef 
  801c7d:	0f b7 d2             	movzwl %dx,%edx
}
  801c80:	89 d0                	mov    %edx,%eax
  801c82:	5d                   	pop    %ebp
  801c83:	c3                   	ret    
  801c84:	66 90                	xchg   %ax,%ax
  801c86:	66 90                	xchg   %ax,%ax
  801c88:	66 90                	xchg   %ax,%ax
  801c8a:	66 90                	xchg   %ax,%ax
  801c8c:	66 90                	xchg   %ax,%ax
  801c8e:	66 90                	xchg   %ax,%ax

00801c90 <__udivdi3>:
  801c90:	f3 0f 1e fb          	endbr32 
  801c94:	55                   	push   %ebp
  801c95:	57                   	push   %edi
  801c96:	56                   	push   %esi
  801c97:	53                   	push   %ebx
  801c98:	83 ec 1c             	sub    $0x1c,%esp
  801c9b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801c9f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801ca3:	8b 74 24 34          	mov    0x34(%esp),%esi
  801ca7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801cab:	85 d2                	test   %edx,%edx
  801cad:	75 19                	jne    801cc8 <__udivdi3+0x38>
  801caf:	39 f3                	cmp    %esi,%ebx
  801cb1:	76 4d                	jbe    801d00 <__udivdi3+0x70>
  801cb3:	31 ff                	xor    %edi,%edi
  801cb5:	89 e8                	mov    %ebp,%eax
  801cb7:	89 f2                	mov    %esi,%edx
  801cb9:	f7 f3                	div    %ebx
  801cbb:	89 fa                	mov    %edi,%edx
  801cbd:	83 c4 1c             	add    $0x1c,%esp
  801cc0:	5b                   	pop    %ebx
  801cc1:	5e                   	pop    %esi
  801cc2:	5f                   	pop    %edi
  801cc3:	5d                   	pop    %ebp
  801cc4:	c3                   	ret    
  801cc5:	8d 76 00             	lea    0x0(%esi),%esi
  801cc8:	39 f2                	cmp    %esi,%edx
  801cca:	76 14                	jbe    801ce0 <__udivdi3+0x50>
  801ccc:	31 ff                	xor    %edi,%edi
  801cce:	31 c0                	xor    %eax,%eax
  801cd0:	89 fa                	mov    %edi,%edx
  801cd2:	83 c4 1c             	add    $0x1c,%esp
  801cd5:	5b                   	pop    %ebx
  801cd6:	5e                   	pop    %esi
  801cd7:	5f                   	pop    %edi
  801cd8:	5d                   	pop    %ebp
  801cd9:	c3                   	ret    
  801cda:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801ce0:	0f bd fa             	bsr    %edx,%edi
  801ce3:	83 f7 1f             	xor    $0x1f,%edi
  801ce6:	75 48                	jne    801d30 <__udivdi3+0xa0>
  801ce8:	39 f2                	cmp    %esi,%edx
  801cea:	72 06                	jb     801cf2 <__udivdi3+0x62>
  801cec:	31 c0                	xor    %eax,%eax
  801cee:	39 eb                	cmp    %ebp,%ebx
  801cf0:	77 de                	ja     801cd0 <__udivdi3+0x40>
  801cf2:	b8 01 00 00 00       	mov    $0x1,%eax
  801cf7:	eb d7                	jmp    801cd0 <__udivdi3+0x40>
  801cf9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d00:	89 d9                	mov    %ebx,%ecx
  801d02:	85 db                	test   %ebx,%ebx
  801d04:	75 0b                	jne    801d11 <__udivdi3+0x81>
  801d06:	b8 01 00 00 00       	mov    $0x1,%eax
  801d0b:	31 d2                	xor    %edx,%edx
  801d0d:	f7 f3                	div    %ebx
  801d0f:	89 c1                	mov    %eax,%ecx
  801d11:	31 d2                	xor    %edx,%edx
  801d13:	89 f0                	mov    %esi,%eax
  801d15:	f7 f1                	div    %ecx
  801d17:	89 c6                	mov    %eax,%esi
  801d19:	89 e8                	mov    %ebp,%eax
  801d1b:	89 f7                	mov    %esi,%edi
  801d1d:	f7 f1                	div    %ecx
  801d1f:	89 fa                	mov    %edi,%edx
  801d21:	83 c4 1c             	add    $0x1c,%esp
  801d24:	5b                   	pop    %ebx
  801d25:	5e                   	pop    %esi
  801d26:	5f                   	pop    %edi
  801d27:	5d                   	pop    %ebp
  801d28:	c3                   	ret    
  801d29:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d30:	89 f9                	mov    %edi,%ecx
  801d32:	b8 20 00 00 00       	mov    $0x20,%eax
  801d37:	29 f8                	sub    %edi,%eax
  801d39:	d3 e2                	shl    %cl,%edx
  801d3b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801d3f:	89 c1                	mov    %eax,%ecx
  801d41:	89 da                	mov    %ebx,%edx
  801d43:	d3 ea                	shr    %cl,%edx
  801d45:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801d49:	09 d1                	or     %edx,%ecx
  801d4b:	89 f2                	mov    %esi,%edx
  801d4d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801d51:	89 f9                	mov    %edi,%ecx
  801d53:	d3 e3                	shl    %cl,%ebx
  801d55:	89 c1                	mov    %eax,%ecx
  801d57:	d3 ea                	shr    %cl,%edx
  801d59:	89 f9                	mov    %edi,%ecx
  801d5b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801d5f:	89 eb                	mov    %ebp,%ebx
  801d61:	d3 e6                	shl    %cl,%esi
  801d63:	89 c1                	mov    %eax,%ecx
  801d65:	d3 eb                	shr    %cl,%ebx
  801d67:	09 de                	or     %ebx,%esi
  801d69:	89 f0                	mov    %esi,%eax
  801d6b:	f7 74 24 08          	divl   0x8(%esp)
  801d6f:	89 d6                	mov    %edx,%esi
  801d71:	89 c3                	mov    %eax,%ebx
  801d73:	f7 64 24 0c          	mull   0xc(%esp)
  801d77:	39 d6                	cmp    %edx,%esi
  801d79:	72 15                	jb     801d90 <__udivdi3+0x100>
  801d7b:	89 f9                	mov    %edi,%ecx
  801d7d:	d3 e5                	shl    %cl,%ebp
  801d7f:	39 c5                	cmp    %eax,%ebp
  801d81:	73 04                	jae    801d87 <__udivdi3+0xf7>
  801d83:	39 d6                	cmp    %edx,%esi
  801d85:	74 09                	je     801d90 <__udivdi3+0x100>
  801d87:	89 d8                	mov    %ebx,%eax
  801d89:	31 ff                	xor    %edi,%edi
  801d8b:	e9 40 ff ff ff       	jmp    801cd0 <__udivdi3+0x40>
  801d90:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801d93:	31 ff                	xor    %edi,%edi
  801d95:	e9 36 ff ff ff       	jmp    801cd0 <__udivdi3+0x40>
  801d9a:	66 90                	xchg   %ax,%ax
  801d9c:	66 90                	xchg   %ax,%ax
  801d9e:	66 90                	xchg   %ax,%ax

00801da0 <__umoddi3>:
  801da0:	f3 0f 1e fb          	endbr32 
  801da4:	55                   	push   %ebp
  801da5:	57                   	push   %edi
  801da6:	56                   	push   %esi
  801da7:	53                   	push   %ebx
  801da8:	83 ec 1c             	sub    $0x1c,%esp
  801dab:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801daf:	8b 74 24 30          	mov    0x30(%esp),%esi
  801db3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801db7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801dbb:	85 c0                	test   %eax,%eax
  801dbd:	75 19                	jne    801dd8 <__umoddi3+0x38>
  801dbf:	39 df                	cmp    %ebx,%edi
  801dc1:	76 5d                	jbe    801e20 <__umoddi3+0x80>
  801dc3:	89 f0                	mov    %esi,%eax
  801dc5:	89 da                	mov    %ebx,%edx
  801dc7:	f7 f7                	div    %edi
  801dc9:	89 d0                	mov    %edx,%eax
  801dcb:	31 d2                	xor    %edx,%edx
  801dcd:	83 c4 1c             	add    $0x1c,%esp
  801dd0:	5b                   	pop    %ebx
  801dd1:	5e                   	pop    %esi
  801dd2:	5f                   	pop    %edi
  801dd3:	5d                   	pop    %ebp
  801dd4:	c3                   	ret    
  801dd5:	8d 76 00             	lea    0x0(%esi),%esi
  801dd8:	89 f2                	mov    %esi,%edx
  801dda:	39 d8                	cmp    %ebx,%eax
  801ddc:	76 12                	jbe    801df0 <__umoddi3+0x50>
  801dde:	89 f0                	mov    %esi,%eax
  801de0:	89 da                	mov    %ebx,%edx
  801de2:	83 c4 1c             	add    $0x1c,%esp
  801de5:	5b                   	pop    %ebx
  801de6:	5e                   	pop    %esi
  801de7:	5f                   	pop    %edi
  801de8:	5d                   	pop    %ebp
  801de9:	c3                   	ret    
  801dea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801df0:	0f bd e8             	bsr    %eax,%ebp
  801df3:	83 f5 1f             	xor    $0x1f,%ebp
  801df6:	75 50                	jne    801e48 <__umoddi3+0xa8>
  801df8:	39 d8                	cmp    %ebx,%eax
  801dfa:	0f 82 e0 00 00 00    	jb     801ee0 <__umoddi3+0x140>
  801e00:	89 d9                	mov    %ebx,%ecx
  801e02:	39 f7                	cmp    %esi,%edi
  801e04:	0f 86 d6 00 00 00    	jbe    801ee0 <__umoddi3+0x140>
  801e0a:	89 d0                	mov    %edx,%eax
  801e0c:	89 ca                	mov    %ecx,%edx
  801e0e:	83 c4 1c             	add    $0x1c,%esp
  801e11:	5b                   	pop    %ebx
  801e12:	5e                   	pop    %esi
  801e13:	5f                   	pop    %edi
  801e14:	5d                   	pop    %ebp
  801e15:	c3                   	ret    
  801e16:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e1d:	8d 76 00             	lea    0x0(%esi),%esi
  801e20:	89 fd                	mov    %edi,%ebp
  801e22:	85 ff                	test   %edi,%edi
  801e24:	75 0b                	jne    801e31 <__umoddi3+0x91>
  801e26:	b8 01 00 00 00       	mov    $0x1,%eax
  801e2b:	31 d2                	xor    %edx,%edx
  801e2d:	f7 f7                	div    %edi
  801e2f:	89 c5                	mov    %eax,%ebp
  801e31:	89 d8                	mov    %ebx,%eax
  801e33:	31 d2                	xor    %edx,%edx
  801e35:	f7 f5                	div    %ebp
  801e37:	89 f0                	mov    %esi,%eax
  801e39:	f7 f5                	div    %ebp
  801e3b:	89 d0                	mov    %edx,%eax
  801e3d:	31 d2                	xor    %edx,%edx
  801e3f:	eb 8c                	jmp    801dcd <__umoddi3+0x2d>
  801e41:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e48:	89 e9                	mov    %ebp,%ecx
  801e4a:	ba 20 00 00 00       	mov    $0x20,%edx
  801e4f:	29 ea                	sub    %ebp,%edx
  801e51:	d3 e0                	shl    %cl,%eax
  801e53:	89 44 24 08          	mov    %eax,0x8(%esp)
  801e57:	89 d1                	mov    %edx,%ecx
  801e59:	89 f8                	mov    %edi,%eax
  801e5b:	d3 e8                	shr    %cl,%eax
  801e5d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801e61:	89 54 24 04          	mov    %edx,0x4(%esp)
  801e65:	8b 54 24 04          	mov    0x4(%esp),%edx
  801e69:	09 c1                	or     %eax,%ecx
  801e6b:	89 d8                	mov    %ebx,%eax
  801e6d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801e71:	89 e9                	mov    %ebp,%ecx
  801e73:	d3 e7                	shl    %cl,%edi
  801e75:	89 d1                	mov    %edx,%ecx
  801e77:	d3 e8                	shr    %cl,%eax
  801e79:	89 e9                	mov    %ebp,%ecx
  801e7b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801e7f:	d3 e3                	shl    %cl,%ebx
  801e81:	89 c7                	mov    %eax,%edi
  801e83:	89 d1                	mov    %edx,%ecx
  801e85:	89 f0                	mov    %esi,%eax
  801e87:	d3 e8                	shr    %cl,%eax
  801e89:	89 e9                	mov    %ebp,%ecx
  801e8b:	89 fa                	mov    %edi,%edx
  801e8d:	d3 e6                	shl    %cl,%esi
  801e8f:	09 d8                	or     %ebx,%eax
  801e91:	f7 74 24 08          	divl   0x8(%esp)
  801e95:	89 d1                	mov    %edx,%ecx
  801e97:	89 f3                	mov    %esi,%ebx
  801e99:	f7 64 24 0c          	mull   0xc(%esp)
  801e9d:	89 c6                	mov    %eax,%esi
  801e9f:	89 d7                	mov    %edx,%edi
  801ea1:	39 d1                	cmp    %edx,%ecx
  801ea3:	72 06                	jb     801eab <__umoddi3+0x10b>
  801ea5:	75 10                	jne    801eb7 <__umoddi3+0x117>
  801ea7:	39 c3                	cmp    %eax,%ebx
  801ea9:	73 0c                	jae    801eb7 <__umoddi3+0x117>
  801eab:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801eaf:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801eb3:	89 d7                	mov    %edx,%edi
  801eb5:	89 c6                	mov    %eax,%esi
  801eb7:	89 ca                	mov    %ecx,%edx
  801eb9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801ebe:	29 f3                	sub    %esi,%ebx
  801ec0:	19 fa                	sbb    %edi,%edx
  801ec2:	89 d0                	mov    %edx,%eax
  801ec4:	d3 e0                	shl    %cl,%eax
  801ec6:	89 e9                	mov    %ebp,%ecx
  801ec8:	d3 eb                	shr    %cl,%ebx
  801eca:	d3 ea                	shr    %cl,%edx
  801ecc:	09 d8                	or     %ebx,%eax
  801ece:	83 c4 1c             	add    $0x1c,%esp
  801ed1:	5b                   	pop    %ebx
  801ed2:	5e                   	pop    %esi
  801ed3:	5f                   	pop    %edi
  801ed4:	5d                   	pop    %ebp
  801ed5:	c3                   	ret    
  801ed6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801edd:	8d 76 00             	lea    0x0(%esi),%esi
  801ee0:	29 fe                	sub    %edi,%esi
  801ee2:	19 c3                	sbb    %eax,%ebx
  801ee4:	89 f2                	mov    %esi,%edx
  801ee6:	89 d9                	mov    %ebx,%ecx
  801ee8:	e9 1d ff ff ff       	jmp    801e0a <__umoddi3+0x6a>
